예제 #1
0
        /// <summary>
        /// 显示坐骑。
        /// </summary>
        /// <param name="skin">坐骑编号。</param>
        public static void ShowRideModel(int skin)
        {
            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 <RideModelShow>();
                DontDestroyOnLoad(CurModeShow);
                CurModeShow.transform.localPosition = new Vector3(0, -1000, 0);
                CurModeShow.transform.localScale    = Vector3.one;
                CurModeShow.transform.forward       = Vector3.forward;
                CurModeShow.mCarmera = obj.GetComponentInChildren <Camera>();
            }

            if (!CurModeShow.gameObject.activeSelf)
            {
                CurModeShow.gameObject.SetActive(true);
            }
            CurModeShow.ShowModel(skin);
        }
예제 #2
0
 void OnDrag(Vector2 delta)
 {
     if (Math.Abs(delta.x) > 0)
     {
         float dt = delta.x / Math.Abs(delta.x) * 4;
         RideModelShow.Rotate(new Vector3(0f, -dt, 0f));
     }
 }
예제 #3
0
 void OnClick(GameObject go)
 {
     RideModelShow.ShowHorseActionAnimation();
 }