示例#1
0
    void Update()
    {
        if (!ship.CanTakeAction())
        {
            return;
        }

        bool actionTaken = false;

        for (int i = 0; i < behaviors.Length && !actionTaken; i++)
        {
            AIBehavior behavior = behaviors[i];

            if (!behavior.AbilityIsReady())
            {
                continue;
            }

            actionTaken = behavior.TakeAction();
        }
    }