예제 #1
0
        static int _m_MovementUpdate(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Pathfinding.AILerp gen_to_be_invoked = (Pathfinding.AILerp)translator.FastGetCSObj(L, 1);



                {
                    float _deltaTime = (float)LuaAPI.lua_tonumber(L, 2);
                    UnityEngine.Vector3    _nextPosition;
                    UnityEngine.Quaternion _nextRotation;

                    gen_to_be_invoked.MovementUpdate(
                        _deltaTime,
                        out _nextPosition,
                        out _nextRotation);
                    translator.PushUnityEngineVector3(L, _nextPosition);

                    translator.PushUnityEngineQuaternion(L, _nextRotation);



                    return(2);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
예제 #2
0
        static int _m_FinalizeMovement(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Pathfinding.AILerp gen_to_be_invoked = (Pathfinding.AILerp)translator.FastGetCSObj(L, 1);



                {
                    UnityEngine.Vector3    _nextPosition; translator.Get(L, 2, out _nextPosition);
                    UnityEngine.Quaternion _nextRotation; translator.Get(L, 3, out _nextRotation);

                    gen_to_be_invoked.FinalizeMovement(
                        _nextPosition,
                        _nextRotation);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
예제 #3
0
        static int _s_set_updateRotation(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Pathfinding.AILerp gen_to_be_invoked = (Pathfinding.AILerp)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.updateRotation = LuaAPI.lua_toboolean(L, 2);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
예제 #4
0
        static int _s_set_switchPathInterpolationSpeed(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Pathfinding.AILerp gen_to_be_invoked = (Pathfinding.AILerp)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.switchPathInterpolationSpeed = (float)LuaAPI.lua_tonumber(L, 2);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
예제 #5
0
        static int _s_set_onSearchPath(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Pathfinding.AILerp gen_to_be_invoked = (Pathfinding.AILerp)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.onSearchPath = translator.GetDelegate <System.Action>(L, 2);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
예제 #6
0
        static int _g_get_interpolatePathSwitches(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Pathfinding.AILerp gen_to_be_invoked = (Pathfinding.AILerp)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushboolean(L, gen_to_be_invoked.interpolatePathSwitches);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
예제 #7
0
        static int _g_get_onSearchPath(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Pathfinding.AILerp gen_to_be_invoked = (Pathfinding.AILerp)translator.FastGetCSObj(L, 1);
                translator.Push(L, gen_to_be_invoked.onSearchPath);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
예제 #8
0
        static int _s_set_destination(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Pathfinding.AILerp  gen_to_be_invoked = (Pathfinding.AILerp)translator.FastGetCSObj(L, 1);
                UnityEngine.Vector3 gen_value; translator.Get(L, 2, out gen_value);
                gen_to_be_invoked.destination = gen_value;
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
예제 #9
0
        // Start is called before the first frame update
        void Start()
        {
            cc = Camera_Controller.Instance;                   // camera instance
            playerController = Player_Controller_RPG.Instance; // player instance

            if (cc == null)
            {
                Debug.LogError("There is no camera controller in the scene!!");
            }
            else
            {
                playerCam = cc.Cam_Obj.GetComponent <Camera>();
            }
            if (playerCam == null)
            {
                Debug.LogError("There is no camera controller in camera controller!!");
            }

            if (playerController == null)
            {
                Debug.LogError("There is no player controller in scene");
                return;
            }
            // read player controller script attached object
            playerOBJ = playerController.gameObject;
            // looking for ai script
            pathRichAI = playerOBJ.GetComponent <Pathfinding.RichAI>();
            pathAIPath = playerOBJ.GetComponent <Pathfinding.AIPath>();
            pathAILerp = playerOBJ.GetComponent <Pathfinding.AILerp>();
            // disable ai because in rpg mode it will conflict with the control
            aiOn = false;
            if (pathRichAI != null)
            {
                pathRichAI.enabled = false;
            }
            else if (pathAIPath != null)
            {
                pathAIPath.enabled = false;
            }
            else if (pathAILerp != null)
            {
                pathAILerp.enabled = false;
            }

            rightClickInfoType = RC_InfoType.None;
        }
예제 #10
0
        static int _m_Teleport(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Pathfinding.AILerp gen_to_be_invoked = (Pathfinding.AILerp)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 3 && translator.Assignable <UnityEngine.Vector3>(L, 2) && LuaTypes.LUA_TBOOLEAN == LuaAPI.lua_type(L, 3))
                {
                    UnityEngine.Vector3 _position; translator.Get(L, 2, out _position);
                    bool _clearPath = LuaAPI.lua_toboolean(L, 3);

                    gen_to_be_invoked.Teleport(
                        _position,
                        _clearPath);



                    return(0);
                }
                if (gen_param_count == 2 && translator.Assignable <UnityEngine.Vector3>(L, 2))
                {
                    UnityEngine.Vector3 _position; translator.Get(L, 2, out _position);

                    gen_to_be_invoked.Teleport(
                        _position);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to Pathfinding.AILerp.Teleport!"));
        }
예제 #11
0
        static int _m_OnTargetReached(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Pathfinding.AILerp gen_to_be_invoked = (Pathfinding.AILerp)translator.FastGetCSObj(L, 1);



                {
                    gen_to_be_invoked.OnTargetReached(  );



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
예제 #12
0
        static int _m_GetFeetPosition(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Pathfinding.AILerp gen_to_be_invoked = (Pathfinding.AILerp)translator.FastGetCSObj(L, 1);



                {
                    UnityEngine.Vector3 gen_ret = gen_to_be_invoked.GetFeetPosition(  );
                    translator.PushUnityEngineVector3(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
예제 #13
0
        static int _m_SetPath(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Pathfinding.AILerp gen_to_be_invoked = (Pathfinding.AILerp)translator.FastGetCSObj(L, 1);



                {
                    PF.Path _path = (PF.Path)translator.GetObject(L, 2, typeof(PF.Path));

                    gen_to_be_invoked.SetPath(_path);



                    return(0);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }