本文整理汇总了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");
}
示例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);
}
示例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");
}
示例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");
}
}
示例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;
}
示例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());
}
示例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");
}
}
示例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();
});
}
}
}
}
}
示例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");
}
示例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");
}
示例11: Start
// Use this for initialization
void Start()
{
transform.position = new Vector3(0, GlobalVariables.playerDefHeight, 0);
anim = GetComponent<Animator>();
anim.ResetTrigger("TriggerHurt");
}
示例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");
}
示例13: Start
void Start () {
anim = GetComponent<Animator>();
anim.SetTrigger("instructionOpen");
anim.ResetTrigger("instructionClose");
}
示例14: OnStateExit
public override void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
{
base.OnStateExit(animator, stateInfo, layerIndex);
animator.ResetTrigger(exit);
}
示例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");
}