public override bool PassCondition(BaseActorController hBaseController)
        {
            if (conditionArray == null || conditionArray.Length <= 0)
            {
                return(true);
            }

            bool bResult = allTrue;

            for (int i = 0; i < conditionArray.Length; i++)
            {
                var hCondtion = conditionArray[i];
                if (hCondtion != null)
                {
                    bool bPass = hCondtion.PassCondition(hBaseController);
                    if (allTrue && !bPass)
                    {
                        return(false);
                    }
                    else if (!allTrue && bPass)
                    {
                        return(true);
                    }
                }
            }

            return(bResult);
        }
        public static void RunEvent(this BaseActorBehaviourEvent[] arrayEvent, BaseActorController hBaseController, BaseActorBehaviour hBaseBehaviour)
        {
            if (arrayEvent == null || arrayEvent.Length <= 0)
            {
                return;
            }

            for (int i = 0; i < arrayEvent.Length; i++)
            {
                var hEvent = arrayEvent[i];
                if (hEvent != null)
                {
                    hEvent.RunEvent(hBaseController, hBaseBehaviour);
                }
            }
        }
Exemplo n.º 3
0
        public override void OnStopBehaviour(BaseActorController hBaseController)
        {
            if (!m_arrBehaviour.HasData())
            {
                return;
            }

            for (int i = 0; i < m_arrBehaviour.Length; i++)
            {
                var hBehaviour = m_arrBehaviour[i];
                if (hBehaviour != null)
                {
                    hBehaviour.OnStopBehaviour(hBaseController);
                }
            }
        }
        public static void RunEvent(this List <BaseActorBehaviourEvent> listEvent, BaseActorController hBaseController, BaseActorBehaviour hBaseBehaviour)
        {
            if (listEvent == null || listEvent.Count <= 0)
            {
                return;
            }

            for (int i = 0; i < listEvent.Count; i++)
            {
                var hEvent = listEvent[i];
                if (hEvent != null)
                {
                    hEvent.RunEvent(hBaseController, hBaseBehaviour);
                }
            }
        }
Exemplo n.º 5
0
        public override void OnUpdateBehaviour(BaseActorController hBaseController)
        {
            base.OnUpdateBehaviour(hBaseController);

            if (!m_arrBehaviour.HasData() || !PassCondition(hBaseController))
            {
                return;
            }

            for (int i = 0; i < m_arrBehaviour.Length; i++)
            {
                var hBehaviour = m_arrBehaviour[i];
                if (hBehaviour != null)
                {
                    hBehaviour.OnUpdateBehaviour(hBaseController);
                }
            }
        }
Exemplo n.º 6
0
 public override void OnStopBehaviour(BaseActorController hBaseController)
 {
 }
Exemplo n.º 7
0
 public abstract void RunEvent(BaseActorController hBaseController, BaseActorBehaviour hBaseBehaviour);
Exemplo n.º 8
0
        public static bool PassCondition(this BaseActorBehaviourCondition[] arrCondition, BaseActorController hBaseController)
        {
            if (arrCondition == null || arrCondition.Length <= 0)
            {
                return(true);
            }

            for (int i = 0; i < arrCondition.Length; i++)
            {
                var hCondition = arrCondition[i];
                if (hCondition != null && !hCondition.PassCondition(hBaseController))
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 9
0
        public static bool PassCondition(this List <BaseActorBehaviourCondition> lstCondition, BaseActorController hBaseController)
        {
            if (lstCondition == null || lstCondition.Count <= 0)
            {
                return(true);
            }

            for (int i = 0; i < lstCondition.Count; i++)
            {
                var hCondition = lstCondition[i];
                if (hCondition != null && !hCondition.PassCondition(hBaseController))
                {
                    return(false);
                }
            }

            return(true);
        }
 protected bool PassAllCondition(BaseActorController hBaseController)
 {
     return(m_arrCondition.PassCondition(hBaseController));
 }
 public override bool PassCondition(BaseActorController hBaseController)
 {
     return(PassAllCondition(hBaseController));
 }
 /// <summary>
 /// Check condition, return true when pass and return false when fail.
 /// </summary>
 public abstract bool PassCondition(BaseActorController hBaseController);
Exemplo n.º 13
0
 public override void OnUpdateBehaviour(BaseActorController hBaseController)
 {
 }
Exemplo n.º 14
0
 public override void OnInterruptBehaviour(BaseActorController hBaseController)
 {
 }
Exemplo n.º 15
0
 public override void OnDestroyBehaviour(BaseActorController hBaseController)
 {
 }
Exemplo n.º 16
0
 public abstract void OnInterruptBehaviour(BaseActorController hBaseController);
Exemplo n.º 17
0
 public abstract void OnStopBehaviour(BaseActorController hBaseController);
Exemplo n.º 18
0
 public abstract void OnLateUpdateBehaviour(BaseActorController hBaseController);
Exemplo n.º 19
0
 /// <summary>
 /// Check all condition, return true when pass and return false when fail.
 /// </summary>
 protected abstract bool PassCondition(BaseActorController hBaseController);