示例#1
0
        IEnumerator LoadDropEffect(string path, Vector3 dropPosition)
        {
            SGameEngine.PrefabResource prefab = new SGameEngine.PrefabResource();

            yield return(SGameEngine.ResourceLoader.Instance.StartCoroutine(SGameEngine.ResourceLoader.Instance.load_prefab(path, prefab)));

            if (prefab != null && prefab.obj_ != null)
            {
                GameObject dropEffectGameObject = prefab.obj_;
                Actor      localPlayer          = Game.GetInstance().GetLocalPlayer();
                if (localPlayer != null)
                {
                    dropEffectGameObject.transform.parent        = null;
                    dropEffectGameObject.transform.localScale    = Vector3.one;
                    dropEffectGameObject.transform.localPosition = dropPosition;
                    dropEffectGameObject.transform.localRotation = Quaternion.identity;

                    TrackAnimationComponent com = dropEffectGameObject.AddComponent <TrackAnimationComponent>();
                    com.TargetTran   = localPlayer.ActorTrans;
                    com.TargetOffset = new Vector3(0f, 0.5f * localPlayer.Height, 0f);
                }
                else
                {
                    GameObject.DestroyImmediate(dropEffectGameObject);
                }
            }
        }
示例#2
0
        static int _g_get_TargetOffset(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                TrackAnimationComponent __cl_gen_to_be_invoked = (TrackAnimationComponent)translator.FastGetCSObj(L, 1);
                translator.PushUnityEngineVector3(L, __cl_gen_to_be_invoked.TargetOffset);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(1);
        }
示例#3
0
        static int _s_set_FinishCallback(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                TrackAnimationComponent __cl_gen_to_be_invoked = (TrackAnimationComponent)translator.FastGetCSObj(L, 1);
                __cl_gen_to_be_invoked.FinishCallback = translator.GetDelegate <System.Action>(L, 2);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(0);
        }
示例#4
0
        static int _s_set_OffsetSpeedDuration(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                TrackAnimationComponent __cl_gen_to_be_invoked = (TrackAnimationComponent)translator.FastGetCSObj(L, 1);
                __cl_gen_to_be_invoked.OffsetSpeedDuration = (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_TargetTran(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                TrackAnimationComponent __cl_gen_to_be_invoked = (TrackAnimationComponent)translator.FastGetCSObj(L, 1);
                __cl_gen_to_be_invoked.TargetTran = (UnityEngine.Transform)translator.GetObject(L, 2, typeof(UnityEngine.Transform));
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(0);
        }
示例#6
0
        static int _g_get_Acceleration(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                TrackAnimationComponent __cl_gen_to_be_invoked = (TrackAnimationComponent)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushnumber(L, __cl_gen_to_be_invoked.Acceleration);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(1);
        }
示例#7
0
        static int _s_set_OriginalOffsetSpeed(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                TrackAnimationComponent __cl_gen_to_be_invoked = (TrackAnimationComponent)translator.FastGetCSObj(L, 1);
                UnityEngine.Vector3     __cl_gen_value; translator.Get(L, 2, out __cl_gen_value);
                __cl_gen_to_be_invoked.OriginalOffsetSpeed = __cl_gen_value;
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(0);
        }
示例#8
0
        static int __CreateInstance(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    TrackAnimationComponent __cl_gen_ret = new TrackAnimationComponent();
                    translator.Push(L, __cl_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 TrackAnimationComponent constructor!"));
        }