本文整理汇总了C#中PlayerController.isPeeking方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerController.isPeeking方法的具体用法?C# PlayerController.isPeeking怎么用?C# PlayerController.isPeeking使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerController
的用法示例。
在下文中一共展示了PlayerController.isPeeking方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Bob
void Bob(PlayerController pc, bool moving)
{
if (moving && !pc.isCrouching() && pc.isGrounded() && !pc.isPeeking() && !isArming())
{
state = BOB;
bool sprinting = player.GetComponent<PlayerController>().isSprinting();
transform.localPosition = Vector3.MoveTowards(transform.localPosition, posArr[i], (sprinting ? sprintSp : regSp) * Time.deltaTime);
if (Vector3.Distance(transform.localPosition, posArr[i]) <= 0.0001f)
{
if (to)
i++;
else
i--;
if (i == 3)
{
i = 1;
to = false;
}
else if (i == -1)
{
i = 0;
to = true;
}
}
}
}
示例2: Sway
void Sway(PlayerController pc, bool moving)
{
if ((!moving || pc.isCrouching()) && !pc.isPeeking() && !isArming())
{
state = SWAY;
float factorX = (Input.GetAxis("Mouse Y")) * amt;
float factorY = -(Input.GetAxis("Mouse X")) * amt;
if (factorX > maxAmt)
factorX = maxAmt;
if (factorX < -maxAmt)
factorX = -maxAmt;
if (factorY > maxAmt)
factorY = maxAmt;
if (factorY < -maxAmt)
factorY = -maxAmt;
Quaternion fin = Quaternion.Euler(def.x + factorX, def.y + factorY, def.z);
transform.localRotation = Quaternion.Slerp(transform.localRotation, fin, (Time.deltaTime * smooth));
}
}