Пример #1
0
 public void RecreateCondition(int i)
 {
     if (actionConditions != null && actionConditions.Count >= i)
     {
         actionConditions[i] = ActionCondition.GenerateBy(conditions[i]);
     }
 }
Пример #2
0
    // Use this for initialization
    public void Update()
    {
        if (actionConditions == null && conditions != null)
        {
            actionConditions = new List <ActionCondition>();

            for (int i = 0; i < conditions.Count; i++)
            {
                actionConditions.Add(ActionCondition.GenerateBy(conditions[i]));
            }
        }

        if (actionConditions != null)
        {
            for (int i = 0; i < actionConditions.Count; i++)
            {
                //Debug.Log("ConditionBasedBehavior::Update - VerifyCondition " + actionConditions[i].VerifyCondition(gameObject));
                if (actionConditions[i].VerifyCondition(gameObject))
                {
                    OnConditionSatisfied();
                }
            }
        }
    }