示例#1
0
        /// <summary>
        /// 显示玩家模型。
        /// </summary>
        /// <param name="type">显示类型。0正面 1技能预览</param>
        public static void ShowPlayerModel(int type = 0)
        {
            if (CurModeShow == null)
            {
                GameObject prefab = (GameObject)CoreEntry.gResLoader.Load(PrefabPath, typeof(GameObject));
                if (prefab == null)
                {
                    return;
                }

                GameObject obj = Instantiate(prefab) as GameObject;
                CurModeShow = obj.GetComponent <PlayerModelShowInfo>();
                CurModeShow.transform.localPosition = new Vector3(0, -1000, 0);
                CurModeShow.transform.localScale    = Vector3.one;
                DefaultRotate        = CurModeShow.ModelParent.rotation;
                CurModeShow.mCarmera = obj.GetComponentInChildren <Camera>();
            }

            if (!CurModeShow.gameObject.activeSelf)
            {
                CurModeShow.gameObject.SetActive(true);
                CurModeShow.ModelParent.rotation = DefaultRotate;
            }
            CurModeShow.ShowModel();
        }
示例#2
0
 void OnDrag(Vector2 delta)
 {
     if (Math.Abs(delta.x) > 0)
     {
         float dt = delta.x / Math.Abs(delta.x) * 8;
         PlayerModelShowInfo.Rotate(new Vector3(0f, -dt, 0f));
     }
 }
示例#3
0
 void OnDrag(Vector2 delta)
 {
     if (Math.Abs(delta.x) > 0)
     {
         float dt = delta.x / Math.Abs(delta.x) * 8;
         if (IsOther)
         {
             OtherPlayerModelShow.Rotate(new Vector3(0f, -dt, 0f));
         }
         else
         {
             PlayerModelShowInfo.Rotate(new Vector3(0f, -dt, 0f));
         }
     }
 }