Exemplo n.º 1
0
        static int _s_set_constrainInsideGraph(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Pathfinding.AIPath gen_to_be_invoked = (Pathfinding.AIPath)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.constrainInsideGraph = LuaAPI.lua_toboolean(L, 2);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
Exemplo n.º 2
0
        static int _s_set_endReachedDistance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Pathfinding.AIPath gen_to_be_invoked = (Pathfinding.AIPath)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.endReachedDistance = (float)LuaAPI.lua_tonumber(L, 2);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
Exemplo n.º 3
0
        static int _g_get_slowWhenNotFacingTarget(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Pathfinding.AIPath gen_to_be_invoked = (Pathfinding.AIPath)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushboolean(L, gen_to_be_invoked.slowWhenNotFacingTarget);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Exemplo n.º 4
0
        static int _g_get_whenCloseToDestination(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Pathfinding.AIPath gen_to_be_invoked = (Pathfinding.AIPath)translator.FastGetCSObj(L, 1);
                translator.PushPFCloseToDestinationMode(L, gen_to_be_invoked.whenCloseToDestination);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Exemplo n.º 5
0
        static int _g_get_pickNextWaypointDist(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Pathfinding.AIPath gen_to_be_invoked = (Pathfinding.AIPath)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushnumber(L, gen_to_be_invoked.pickNextWaypointDist);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Exemplo n.º 6
0
        static int _g_get_steeringTarget(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Pathfinding.AIPath gen_to_be_invoked = (Pathfinding.AIPath)translator.FastGetCSObj(L, 1);
                translator.PushUnityEngineVector3(L, gen_to_be_invoked.steeringTarget);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Exemplo n.º 7
0
        static int _s_set_whenCloseToDestination(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                Pathfinding.AIPath        gen_to_be_invoked = (Pathfinding.AIPath)translator.FastGetCSObj(L, 1);
                PF.CloseToDestinationMode gen_value; translator.Get(L, 2, out gen_value);
                gen_to_be_invoked.whenCloseToDestination = gen_value;
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
Exemplo n.º 8
0
        static int __CreateInstance(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    Pathfinding.AIPath gen_ret = new Pathfinding.AIPath();
                    translator.Push(L, gen_ret);

                    return(1);
                }
            }
            catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to Pathfinding.AIPath constructor!"));
        }
Exemplo n.º 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;
        }
Exemplo n.º 10
0
        static int _m_Teleport(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Pathfinding.AIPath gen_to_be_invoked = (Pathfinding.AIPath)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 _newPosition; translator.Get(L, 2, out _newPosition);
                    bool _clearPath = LuaAPI.lua_toboolean(L, 3);

                    gen_to_be_invoked.Teleport(
                        _newPosition,
                        _clearPath);



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

                    gen_to_be_invoked.Teleport(
                        _newPosition);



                    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.AIPath.Teleport!"));
        }
Exemplo n.º 11
0
        static int _m_OnTargetReached(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                Pathfinding.AIPath gen_to_be_invoked = (Pathfinding.AIPath)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));
            }
        }