예제 #1
0
        override public float Run()
        {
            var bridge = DialogueManager.Instance.GetComponent <AdventureCreatorBridge>();

            if (syncData && (bridge != null))
            {
                bridge.SyncAdventureCreatorToLua();
            }
            Lua.Result luaResult = Lua.NoResult;
            if (!string.IsNullOrEmpty(luaCode))
            {
                luaResult = Lua.Run(luaCode, DialogueDebug.LogInfo);
            }
            if (syncData && (bridge != null))
            {
                bridge.SyncLuaToAdventureCreator();
            }
            if (updateQuestTracker)
            {
                DialogueManager.SendUpdateTracker();
            }
            DialogueManager.CheckAlerts();
            if (storeResult)
            {
                AC.GlobalVariables.SetStringValue(variableID, luaResult.AsString);
            }
            return(0);
        }
예제 #2
0
        override public float Run()
        {
            /*
             * This function is called when the action is performed.
             *
             * The float to return is the time that the game
             * should wait before moving on to the next action.
             * Return 0f to make the action instantenous.
             *
             * For actions that take longer than one frame,
             * you can return "defaultPauseTime" to make the game
             * re-run this function a short time later. You can
             * use the isRunning boolean to check if the action is
             * being run for the first time, eg:
             */

            var bridge = DialogueManager.Instance.GetComponent <AdventureCreatorBridge>();

            if (syncData && (bridge != null))
            {
                bridge.SyncAdventureCreatorToLua();
            }
            Lua.Result luaResult = Lua.NoResult;
            if (!string.IsNullOrEmpty(luaCode))
            {
                luaResult = Lua.Run(luaCode, DialogueDebug.LogInfo);
            }
            if (syncData && (bridge != null))
            {
                bridge.SyncLuaToAdventureCreator();
            }
            if (updateQuestTracker)
            {
                DialogueManager.SendUpdateTracker();
            }
            DialogueManager.CheckAlerts();
            if (storeResult)
            {
                AC.GlobalVariables.SetStringValue(variableID, luaResult.AsString);
            }
            return(0);
        }