本文整理汇总了C#中Fighter.disableAnimator方法的典型用法代码示例。如果您正苦于以下问题:C# Fighter.disableAnimator方法的具体用法?C# Fighter.disableAnimator怎么用?C# Fighter.disableAnimator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fighter
的用法示例。
在下文中一共展示了Fighter.disableAnimator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override void Execute(Fighter fighterRef, PlayerCombatScript combatScript)
{
this.gameObject.SetActive(true);
this.gameObject.GetComponent<SpriteRenderer>().enabled = true;
_fighterRef = fighterRef;
_combatScript = combatScript;
_fighterRef.disableAnimator();
//turn off collisions for fighter ref
Rigidbody2D body = this.gameObject.GetComponent<Rigidbody2D>();
if (_airAttack)
{
//If air attack, dont stop momentum, but pause it on hit.
//Create on hit function
body.gravityScale = _fighterRef.GetComponent<Rigidbody2D>().gravityScale;
Vector2 v = _fighterRef.GetComponent<Rigidbody2D>().velocity;
body.velocity = v;
if(_isDiveKick)
{
Vector2 diveSpeed = new Vector2(4, -3);
body.velocity = diveSpeed;
fighterRef.GetComponent<Rigidbody2D>().velocity = diveSpeed;
}
}
else if(_translate && fighterRef.GetComponent<PlayerControllerScript>())
{
Debug.Log("Translate");
fighterRef.GetComponent<PlayerDash>().ForceEndDash();
}
else if (_fighterRef.tag == "Player")
_fighterRef.GetComponent<PlayerControllerScript>().StopMovement();
if (!_fighterRef.FacingRight)
transform.localScale = new Vector3(1, transform.localScale.y, transform.localScale.z);
else
transform.localScale = new Vector3(-1, transform.localScale.y, transform.localScale.z);
}