예제 #1
0
            protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
            {
                Debug.Check(childStatus == EBTStatus.BT_RUNNING);
                Debug.Check(this.m_node is WaitState, "node is not an WaitState");
                WaitState pStateNode = (WaitState)this.m_node;

                if (this.GetIgnoreTimeScale())
                {
                    if (Workspace.Instance.TimeSinceStartup * 1000.0f - this.m_start >= this.m_time)
                    {
                        return(EBTStatus.BT_SUCCESS);
                    }
                }
                else
                {
                    this.m_start += Workspace.Instance.DeltaTime * 1000.0f;

                    if (this.m_start >= this.m_time)
                    {
                        EBTStatus result = pStateNode.Update(pAgent, out this.m_nextStateId);

                        return(EBTStatus.BT_SUCCESS);
                    }
                }

                return(EBTStatus.BT_RUNNING);
            }
예제 #2
0
            protected override EBTStatus update(Agent pAgent, EBTStatus childStatus)
            {
                Debug.Check(childStatus == EBTStatus.BT_RUNNING);
                Debug.Check(this.m_node is WaitState, "node is not an WaitState");
                WaitState pStateNode = (WaitState)this.m_node;

                if (Workspace.Instance.UseIntValue)
                {
                    if (Workspace.Instance.IntValueSinceStartup - this.m_intStart >= this.m_intTime)
                    {
                        pStateNode.Update(pAgent, out this.m_nextStateId);
                        return(EBTStatus.BT_SUCCESS);
                    }
                }
                else
                {
                    if (Workspace.Instance.DoubleValueSinceStartup - this.m_start >= this.m_time)
                    {
                        pStateNode.Update(pAgent, out this.m_nextStateId);
                        return(EBTStatus.BT_SUCCESS);
                    }
                }

                return(EBTStatus.BT_RUNNING);
            }
예제 #3
0
            private float GetTime(Agent pAgent)
            {
                WaitState pWaitNode = this.GetNode() as WaitState;

                return(pWaitNode != null?pWaitNode.GetTime(pAgent) : 0);
            }
예제 #4
0
            private bool GetIgnoreTimeScale()
            {
                WaitState pWaitNode = this.GetNode() as WaitState;

                return(pWaitNode != null ? pWaitNode.m_ignoreTimeScale : false);
            }