public void OnReceiveDamage(HealthController.DamageData data) { if (cd.isReadyRestart()) { animator.SetTrigger(animationCodeCasched[randomChance.GetRandedId()]); } }
AiBehaviourBase selectNewBehaviour() { if (currentBehaviour && currentBehaviour.nextBehaviour) { return(currentBehaviour.nextBehaviour); } for (int i = 0; i < conditions.Length; ++i) { float utility = conditions[i].GetUtility(); conditionChance.chances[i] = utility >= utilityThreshold ? utility : 0; conditionChance.chances[i] = conditions[i].enabled && conditions[i].behaviour.CanEnter() ? conditionChance.chances[i] : 0; } var v = conditions[conditionChance.GetRandedId()]; return(v.behaviour); }