当前位置: 首页>>代码示例>>C#>>正文


C# Animator.ResetTrigger方法代码示例

本文整理汇总了C#中Animator.ResetTrigger方法的典型用法代码示例。如果您正苦于以下问题:C# Animator.ResetTrigger方法的具体用法?C# Animator.ResetTrigger怎么用?C# Animator.ResetTrigger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Animator的用法示例。


在下文中一共展示了Animator.ResetTrigger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnStateExit

 // OnStateEnter is called before OnStateEnter is called on any state inside this state machine
 //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
 //
 //}
 // OnStateUpdate is called before OnStateUpdate is called on any state inside this state machine
 //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
 //
 //}
 // OnStateExit is called before OnStateExit is called on any state inside this state machine
 public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     animator.ResetTrigger("prep");
     animator.ResetTrigger("draw");
     animator.ResetTrigger("vote");
     animator.ResetTrigger("result");
 }
开发者ID:BoldBigflank,项目名称:Doodoodle-unity,代码行数:16,代码来源:GameStateBehaviorScript.cs

示例2: OnStateExit

 public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     animator.ResetTrigger ("Attack1");
     animator.ResetTrigger ("Attack2");
     animator.ResetTrigger ("Attack3");
     animator.ResetTrigger ("ChargedAttack");
     animator.SetBool ("HeavyCombo", false);
 }
开发者ID:ALapidis,项目名称:AmberIsles,代码行数:8,代码来源:ClearAttackTriggersOnExit.cs

示例3: OnStateExit

 // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
 //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
 //
 //}
 // OnStateExit is called when a transition ends and the state machine finishes evaluating this state
 public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     animator.GetComponent<Character>().Attack = false;
     if (stateInfo.IsTag("attack")) {
         animator.GetComponent<Character>().MeleeAttack();
     }
     animator.ResetTrigger("attack");
     animator.ResetTrigger("throw");
 }
开发者ID:sircuddles,项目名称:inScope-Studios-2D-Platformer,代码行数:14,代码来源:AttackBehavior.cs

示例4: OnStateUpdate

 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
 //
 //}
 // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
 public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateinfo, int layerindex)
 {
     if (Player.Instance.OnGround) {
         animator.SetBool("land", false);
         animator.ResetTrigger("jump");
     }
 }
开发者ID:sircuddles,项目名称:inScope-Studios-2D-Platformer,代码行数:12,代码来源:LandBehavior.cs

示例5: Start

	//public static bool fade = false;
	void Start () {
		
		anim = GetComponent<Animator>();
		spr = GetComponent<SpriteRenderer>();
		anim.ResetTrigger("boltFade");
		bolt = false;
		//		spr.color = Color.red;
		//		Debug.Log(spr.color);
		//gameObject.GetComponent<Rigidbody2D>().simulated = false;
		
		
	}
开发者ID:aanupam3,项目名称:PIAB-Unity-master,代码行数:13,代码来源:boltFade.cs

示例6: OnStateUpdate

    // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
    public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        var minion = animator.gameObject.GetComponent<Minion>();
        minion.navMeshAgent.SetDestination(minion.gatheringFlag.transform.position);
        minion.navMeshAgent.Resume();

        Minion.TargetType targetType = minion.UpdateTarget();
        if (targetType == Minion.TargetType.Minion)
        {
            animator.SetTrigger("TargetMinion");
            animator.ResetTrigger("TargetConstruction");
            animator.ResetTrigger("NoTarget");
        }
        else if (targetType == Minion.TargetType.Construction)
        {
            animator.SetTrigger("TargetConstruction");
            animator.ResetTrigger("TargetMinion");
            animator.ResetTrigger("NoTarget");
        }
        else
        {
            animator.SetTrigger("NoTarget");
            animator.ResetTrigger("TargetConstruction");
            animator.ResetTrigger("TargetMinion");
        }

        animator.SetBool("Arrived", minion.HasArrived());
    }
开发者ID:MangoSister,项目名称:PinballValley,代码行数:29,代码来源:MinionFollowState.cs

示例7: OnStateUpdate

    // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
    public override void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        var minion = animator.gameObject.GetComponent<Minion>();

        minion.ChaseEnemy();
        attackTimer += Time.deltaTime;
        if(attackTimer >= attackInterval)
        {
            attackTimer -= attackInterval;
            minion.AttackEnemy();
        }

        Vector3 currFlagPos = flag.transform.position;

        if ((enterFlagPos - currFlagPos).sqrMagnitude >
        flag.smallMoveRange *
        flag.smallMoveRange)
            animator.SetBool("FlagMove", true);
        else animator.SetBool("FlagMove", false);

        //animator.SetBool("FlagMove", (enterFlagPos - currFlagPos).sqrMagnitude >
        //flag.smallMoveRange *
        //flag.smallMoveRange);

        Minion.TargetType targetType = minion.UpdateTarget();
        if (targetType == Minion.TargetType.Minion)
        {
            animator.SetTrigger("TargetMinion");
            animator.ResetTrigger("TargetConstruction");
            animator.ResetTrigger("NoTarget");
        }
        else if (targetType == Minion.TargetType.Construction)
        {
            animator.SetTrigger("TargetConstruction");
            animator.ResetTrigger("TargetMinion");
            animator.ResetTrigger("NoTarget");
        }
        else
        {
            animator.SetTrigger("NoTarget");
            animator.ResetTrigger("TargetConstruction");
            animator.ResetTrigger("TargetMinion");
        }
    }
开发者ID:MangoSister,项目名称:PinballValley,代码行数:45,代码来源:MinionAttackConstState.cs

示例8: CarsContainerCheck

    private static void CarsContainerCheck(MoleculeContainer target, Animator animator, MoleculeCar[] cars)
    {
        foreach (var car in cars)
        {
            if (car.State == MoleculeCar.CarState.Waiting)
            {
                var carCargos = car.gameObject.GetComponentsInChildren<MoleculeCarCargo>();

                foreach (var cargo in carCargos)
                {
                    if (!cargo.IsLoaded && cargo.Formula == target.ContainerFormula && target.CollectCount > 5 && !target.IsAnimated)
                    {
                        /*
                        var go = (GameObject)Instantiate(ContainerPrefab, Vector3.zero, Quaternion.identity);
                        go.transform.parent = cargo.gameObject.transform;
                        go.transform.position = cargo.gameObject.transform.position;
                        go.transform.localPosition = Vector3.zero;
                        go.transform.localScale = Vector3.one * 0.001f;
                        */
                        target.IsAnimated = true;

                        target.gameObject.transform.parent = null;
                        var throwTo = target.gameObject.AddComponent<ThrowBehavior>();
                        throwTo.Projectile = target.gameObject.transform;
                        throwTo.Target = cargo.gameObject.transform;
                        throwTo.firingAngle = 45f;
                        var currentCar = car;
                        var currentCargo = cargo;
                        throwTo.AfterThrowAction = new Action(() =>
                        {
                            target.transform.parent = currentCargo.transform;
                            target.transform.position = currentCargo.gameObject.transform.position;
                            target.transform.localPosition = Vector3.zero;
                            target.transform.localScale = Vector3.one * 0.001f;
                            // target.Get(10);
                            currentCargo.IsLoaded = true;
                            if (!target.CanGet(1))
                            {
                                if (animator != null)
                                    animator.ResetTrigger(enoughsourcestrigger);
                            }

                            var stopPoint = GameObject.Find("StopPoint" + currentCar.Index);
                            var coin = stopPoint.GetComponentInChildren<MoleculeCoin>();
                            coin.BornCoin();
                        });
                    }
                }

            }
        }
    }
开发者ID:xaml78,项目名称:prototype01,代码行数:52,代码来源:MoleculeScene.cs

示例9: OnStateExit

	// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
	//override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
	//
	//}

	// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
	override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
        animator.GetComponent<Character>().Attack = false;
        animator.ResetTrigger("attack");
        animator.ResetTrigger("throw");
    }
开发者ID:nschroedl,项目名称:Practice-Project-1,代码行数:11,代码来源:AttackBehavior.cs

示例10: OnStateExit

    // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
    //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
    //
    //}

    // OnStateExit is called when a transition ends and the state machine finishes evaluating this state
    override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        Player.Instance.Attack = false;
        animator.ResetTrigger("uppercut");
        animator.ResetTrigger("throw");
    }
开发者ID:geeklicantropo,项目名称:catdog,代码行数:12,代码来源:AttackBehaviour.cs

示例11: Start

 // Use this for initialization
 void Start()
 {
     transform.position = new Vector3(0, GlobalVariables.playerDefHeight, 0);
     anim = GetComponent<Animator>();
     anim.ResetTrigger("TriggerHurt");
 }
开发者ID:kvicksilv3r,项目名称:Unity,代码行数:7,代码来源:PlayerScript.cs

示例12: OnStateExit

 // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
 //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
 //
 //}
 // OnStateExit is called when a transition ends and the state machine finishes evaluating this state
 public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     Player.Instance.Jump = false;
     animator.ResetTrigger("jump");
 }
开发者ID:sircuddles,项目名称:inScope-Studios-2D-Platformer,代码行数:10,代码来源:JumpBehavior.cs

示例13: Start

	void Start () {
		anim = GetComponent<Animator>();
		anim.SetTrigger("instructionOpen");
		anim.ResetTrigger("instructionClose");
	}
开发者ID:aanupam3,项目名称:PIAB-Unity-master,代码行数:5,代码来源:speechBubbleQ.cs

示例14: OnStateExit

 public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     base.OnStateExit(animator, stateInfo, layerIndex);
     animator.ResetTrigger(exit);
 }
开发者ID:KurtLoeffler,项目名称:Stealth,代码行数:5,代码来源:AIHunt.cs

示例15: OnStateExit

	// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
	//override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
	//
	//}

	// OnStateExit is called when a transition ends and the state machine finishes evaluating this state
	override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) {
        Player.Instance.Slide = false;
        animator.ResetTrigger("slide");
	}
开发者ID:nschroedl,项目名称:Practice-Project-1,代码行数:10,代码来源:SlideBehavior.cs


注:本文中的Animator.ResetTrigger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。