Ejemplo n.º 1
0
        public void UpdateElligibleFSM(ref FSMState OldFSMState, ref FSMState NewFSMState, FSM FSM)
        {
            if (OldFSMState == null)
            {
                FSMUpdateElligible.Add(FSM.GetInstanceID(), FSM);
                FSMFixedUpdateElligible.Add(FSM.GetInstanceID(), FSM);
                FSMLateUpdateElligible.Add(FSM.GetInstanceID(), FSM);
            }
            else
            {
                if (NewFSMState.FSMUpdateActions.Length > 0)
                {
                    if (OldFSMState.FSMUpdateActions.Length == 0)
                    {
                        FSMUpdateElligible.Add(FSM.GetInstanceID(), FSM);
                    }
                }
                else
                {
                    if (OldFSMState.FSMUpdateActions.Length > 0)
                    {
                        FSMUpdateElligible.Remove(FSM.GetInstanceID());
                    }
                }


                if (NewFSMState.FSMFixedActions.Length > 0)
                {
                    if (OldFSMState.FSMFixedActions.Length == 0)
                    {
                        FSMFixedUpdateElligible.Add(FSM.GetInstanceID(), FSM);
                    }
                }
                else
                {
                    if (OldFSMState.FSMFixedActions.Length > 0)
                    {
                        FSMFixedUpdateElligible.Remove(FSM.GetInstanceID());
                    }
                }



                if (NewFSMState.FSMLateUpdateActions.Length > 0)
                {
                    if (OldFSMState.FSMLateUpdateActions.Length == 0)
                    {
                        FSMLateUpdateElligible.Add(FSM.GetInstanceID(), FSM);
                    }
                }
                else
                {
                    if (OldFSMState.FSMLateUpdateActions.Length > 0)
                    {
                        FSMLateUpdateElligible.Remove(FSM.GetInstanceID());
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void AddElligibleFSM(FSM FSM)
 {
     if (FSM.CurrentFSMState.FSMUpdateActions.Length > 0)
     {
         FSMUpdateElligible.Add(FSM.GetInstanceID(), FSM);
     }
     if (FSM.CurrentFSMState.FSMFixedActions.Length > 0)
     {
         FSMFixedUpdateElligible.Add(FSM.GetInstanceID(), FSM);
     }
     if (FSM.CurrentFSMState.FSMLateUpdateActions.Length > 0)
     {
         FSMLateUpdateElligible.Add(FSM.GetInstanceID(), FSM);
     }
 }
Ejemplo n.º 3
0
        private static void FormatAndWriteLine(string line, FSM FSM)
        {
            string lineToWrite = Format();

            lineToWrite += FSM.name + "/" + FSM.GetInstanceID() + " - " + line;
            WriteToDebug(lineToWrite);
        }
Ejemplo n.º 4
0
 private void RemoveElligibleFSM(FSM FSM)
 {
     FSMUpdateElligible.Remove(FSM.GetInstanceID());
     FSMFixedUpdateElligible.Remove(FSM.GetInstanceID());
     FSMLateUpdateElligible.Remove(FSM.GetInstanceID());
 }
Ejemplo n.º 5
0
 public void RemoveFSM(FSM FSM)
 {
     FSMContainer.Remove(FSM.GetInstanceID());
     RemoveElligibleFSM(FSM);
 }
Ejemplo n.º 6
0
 public void AddFSM(FSM FSM)
 {
     FSMContainer.Add(FSM.GetInstanceID(), FSM);
     AddElligibleFSM(FSM);
 }