void OnDrag(Vector2 delta) { if (Math.Abs(delta.x) > 0) { float dt = delta.x / Math.Abs(delta.x) * 8; TeamModelShow.Rotate(Index, new Vector3(0f, -dt, 0f)); } }
/// <summary> /// 显示队伍模型。 /// </summary> public static void ShowTeamModel() { 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 <TeamModelShow>(); DontDestroyOnLoad(CurModeShow); CurModeShow.transform.localPosition = new Vector3(0, -1000, 0); CurModeShow.transform.localScale = Vector3.one; CurModeShow.transform.forward = Vector3.forward; } if (!CurModeShow.gameObject.activeSelf) { CurModeShow.gameObject.SetActive(true); } CurModeShow.Refresh(); }