示例#1
0
        /// <summary>
        /// 显示玩家模型。
        /// </summary>
        public static void ShowOtherPlayerModel()
        {
            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 <OtherPlayerModelShow>();
                DontDestroyOnLoad(CurModeShow);
                CurModeShow.transform.localPosition = new Vector3(0, -1000, 0);
                CurModeShow.transform.localScale    = Vector3.one;
                //CurModeShow.transform.forward = Vector3.forward;
                DefaultRotate = CurModeShow.ModelParent.rotation;
            }

            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;
         if (IsOther)
         {
             OtherPlayerModelShow.Rotate(new Vector3(0f, -dt, 0f));
         }
         else
         {
             PlayerModelShowInfo.Rotate(new Vector3(0f, -dt, 0f));
         }
     }
 }