Esempio n. 1
0
        public virtual void UpdateTask()
        {
            if (Actions.Count == 0)
            {
                return;                   // No More Actions
            }
            if (CurrentAction.IsComplete) // If Action is complete, pop from queue
            {
                //Debug.Log("Ship [" + gameObject.name + "] doing [" + GetType().Name + "] completed action [" + Actions.Peek().GetType().Name + "].");

                Actions.Dequeue().Exit();

                if (Actions.Count > 0)
                {
                    //Debug.Log("Ship [" + gameObject.name + "] doing [" + GetType().Name + "] completed action [" + Actions.Peek().GetType().Name + "].");

                    CurrentAction.Enter();
                }
                else
                {
                    //SDebug.Log("Ship [" + gameObject.name + "] doing [" + GetType().Name + "] completed ALL actions.");
                }

                stageBegan = Time.realtimeSinceStartup;
            }

            if (CurrentAction != null)
            {
                CurrentAction.UpdateAction();
            }
        }
        public override void UpdateTask()
        {
            if (Actions.Count == 0)
            {
                return;                   // No More Actions
            }
            if (CurrentAction.IsComplete) // If Action is complete, pop from queue
            {
                Actions.Dequeue().Exit();

                if (Actions.Count > 0)
                {
                    Actions.Peek().Enter();
                }
            }

            if (CurrentAction != null)
            {
                CurrentAction.UpdateAction();
            }
        }
Esempio n. 3
0
    protected override void Update()
    {
        Status.PrepareState();
        for (int i = 0; i < StateStack.Count; ++i)
        {
            StateStack[i].UpdateState();
        }

        foreach (var deletedState in DeleteStateList)
        {
            StateStack.Remove(deletedState);
        }

        if (UseCardStack.Count != 0 && !(CurrentAction is PlayerCardAction))
        {
            EntityUtil.ChangeCardAction(this, UseCardStack[0].card.CardActionName, UseCardStack[0].card.Data, UseCardStack[0].target);
            UseCardStack.RemoveAt(0);
        }
        else
        {
            CurrentAction?.UpdateAction();
        }
    }