Ejemplo n.º 1
0
        /// <summary>
        /// 模型加载完毕后的回调
        /// </summary>
        /// <param name="actor"></param>
        void OnModelLoaded(Actor actor)
        {
            if (actor == null)
            {
                return;
            }

            if (this.IsShow == false)
            {
                DestroyPreviewModel();
                return;
            }

            if (string.IsNullOrEmpty(m_AnimationName) == false)
            {
                actor.CrossFade(m_AnimationName);
                float delay_time = actor.GetAnimationLength(m_AnimationName);
                MainGame.HeartBehavior.StartCoroutine(PlayIdle(actor, delay_time, "idle"));
            }

            var go = actor.GetModelParent();

            m_PreviewTexture.SetGameObject(go);
            m_PreviewTexture.EnableRotate(false);
            //go.transform.localEulerAngles = new Vector3(0, -50, 0);
        }
Ejemplo n.º 2
0
        static int _m_SetGameObject(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UIPreviewTexture __cl_gen_to_be_invoked = (UIPreviewTexture)translator.FastGetCSObj(L, 1);


            try {
                {
                    UnityEngine.GameObject go = (UnityEngine.GameObject)translator.GetObject(L, 2, typeof(UnityEngine.GameObject));

                    __cl_gen_to_be_invoked.SetGameObject(go);



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