Example #1
0
        //do it by invoking method
        protected override bool OnCheck()
        {
            if (functionWrapper == null)
            {
                return(true);
            }

            if (checkValue.varType == typeof(float))
            {
                return(OperationTools.Compare((float)functionWrapper.Call(), (float)checkValue.value, comparison, 0.05f));
            }
            if (checkValue.varType == typeof(int))
            {
                return(OperationTools.Compare((int)functionWrapper.Call(), (int)checkValue.value, comparison));
            }
            return(object.Equals(functionWrapper.Call(), checkValue.value));
        }
Example #2
0
        //do it by invoking method
        protected override void OnExecute()
        {
            if (functionWrapper == null)
            {
                EndAction(false);
                return;
            }

            functionWrapper.Call();
            EndAction();
        }
        void Forward()
        {
            if (functionWrapper == null)
            {
                EndAction(false);
                return;
            }

            actionStatus = (Status)functionWrapper.Call();

            if (actionStatus == Status.Success)
            {
                EndAction(true);
                return;
            }

            if (actionStatus == Status.Failure)
            {
                EndAction(false);
                return;
            }
        }
        protected override void OnUpdate()
        {
            if (functionWrapper == null)
            {
                EndAction(false);
                return;
            }

            actionStatus = (Status)functionWrapper.Call();

            if (actionStatus == Status.Success)
            {
                EndAction(true);
                return;
            }

            if (actionStatus == Status.Failure)
            {
                EndAction(false);
                return;
            }
        }