public void Interrupt()
        {
            if (_currentBattleActionScript != null)
            {
                _currentBattleActionScript.Interrupt();
            }

            _currentBattleActionScript = null;
        }
Exemple #2
0
        public static BattleAction GetBattleAction(AICharacter aiChar, BattleActionScript script, BattleActionData data)
        {
            switch (data.type)
            {
            case TYPE.PLAY_ANIM: return(new BattleActionPlayAnim(aiChar, script, data as BattleActionPlayAnimData));
            }

            Debug.LogWarning("Invalid BattleActionData type detected: " + data.type);
            return(null);
        }
 public BattleActionScriptContainer(AICharacter aiChar, BattleActionScriptContainerData scriptContainerData)
 {
     _dictOfBattleActionScripts = new Dictionary <string, BattleActionScript>();
     for (int i = 0; i < scriptContainerData.actionScriptDataList.Count; ++i)
     {
         BattleActionScriptData scriptData = scriptContainerData.actionScriptDataList[i];
         BattleActionScript     script     = new BattleActionScript(aiChar, this, scriptData);
         _dictOfBattleActionScripts.Add(script.Id, script);
     }
 }
 public void PlayScript(string scriptId, System.Action scriptCompletedFunc = null)
 {
     if (_dictOfBattleActionScripts.ContainsKey(scriptId))
     {
         _currentBattleActionScript = _dictOfBattleActionScripts[scriptId];
         _currentBattleActionScript.Start(scriptCompletedFunc);
     }
     else
     {
         Debug.Log("Error: Invalid script id: " + scriptId);
     }
 }
Exemple #5
0
 virtual public void Init(BattleActionScript battleActionScript)
 {
     _frame       = Mathf.FloorToInt(_actionData.frame * battleActionScript.GetTimeScale());
     _framestoRun = Mathf.FloorToInt(_actionData.framesToRun * battleActionScript.GetTimeScale());
 }
Exemple #6
0
 public BattleAction(AICharacter aiChar, BattleActionScript actionScript, BattleActionData actionData)
 {
     _aiCharacter  = aiChar;
     _actionScript = actionScript;
     _actionData   = actionData;
 }
 public BattleActionPlayAnim(AICharacter aiChar, BattleActionScript actionScript, BattleActionPlayAnimData actionPlayAnimData) : base(aiChar, actionScript, actionPlayAnimData)
 {
     _data = actionPlayAnimData;
 }