示例#1
0
        public void SetEntryAction(string actionName)
        {
            if (ai_InOperation)
            {
                Debug.Log("AI가 동작중에는 EntryAction을 변경할 수 없음");
                return;
            }
            AIAction foundAction = null;

            if (!aiActions.TryGetValue(actionName, out foundAction))
            {
                PrintDebug_InvaildAction(actionName);
                return;
            }
            currentAction = foundAction;
        }
示例#2
0
        public void AddTransition(string startActionName, string transtionKey, string targetActionName)
        {
            AIAction foundStartAction  = null;
            AIAction foundTargetAction = null;

            if (!aiActions.TryGetValue(startActionName, out foundStartAction))
            {
                PrintDebug_InvaildAction(startActionName);
                return;
            }
            if (!aiActions.TryGetValue(targetActionName, out foundTargetAction))
            {
                PrintDebug_InvaildAction(targetActionName);
                return;
            }
            foundStartAction.AddTransition(transtionKey, new ActionTransition(foundTargetAction));
        }
示例#3
0
        public void ConnectIntegerOnTranstion(string actionName, string parameterName, int valueForTransit, string transitionName)
        {
            AIAction foundAction    = null;
            bool     foundParameter = false;

            if (!aiActions.TryGetValue(actionName, out foundAction))
            {
                PrintDebug_InvaildAction(actionName);
                return;
            }
            if (!booleanParameters.TryGetValue(parameterName, out foundParameter))
            {
                PrintDebug_InvaildParameter(parameterName);
                return;
            }
            if (!foundAction.ConnectIntergerOnTransition(transitionName, parameterName, valueForTransit))
            {
                PrintDebug_InvaildTransition(actionName, transitionName);
            }
        }
 public ActionTransition(AIAction target)
 {
     targetAction      = target;
     booleanParameters = new Dictionary <string, bool>();
     integerParameters = new Dictionary <string, int>();
 }
示例#5
0
 public void SetCurrentAction(AIAction action)
 {
     currentAction = action;
 }