コード例 #1
0
 public void OnReceiveDamage(HealthController.DamageData data)
 {
     if (cd.isReadyRestart())
     {
         animator.SetTrigger(animationCodeCasched[randomChance.GetRandedId()]);
     }
 }
コード例 #2
0
    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);
    }