void Update() { if (UICamera.hoveredObject == null) { if (Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { if (hit.transform.tag != "shu") { currentObj = hit.transform.gameObject; roleId = int.Parse(currentObj.name); if (isCreate) { if (XuanPanel.SetRoleinfo != null) { XuanPanel.SetRoleinfo(true); } if (XuanPanel.Instance != null) { XuanPanel.Instance.createNameObj.GetComponent <StartGame>().ShowPlayerDes(roleId); XuanPanel.Instance.SetIconShowState(false); } DisplaySelectedRole(roleId); ani.enabled = false; Hashtable has = new Hashtable(); has.Add("speed", 4f); has.Add("time", 1f); //has.Add("looktarget",currentObj.transform.position); has.Add("onstarttarget", CameraPositions[roleId - 1].gameObject); has.Add("position", CameraPositions[roleId - 1].position); iTween.MoveTo(Camera.main.gameObject, has); //iTween.RotateTo(Camera.main.gameObject,has); } else { if (XuanPanel.SetRoleinfo != null) { XuanPanel.SetRoleinfo(false); } if (XuanPanel.SetPlayerPanleInfo != null) { XuanPanel.SetPlayerPanleInfo(roleId); } } } } } } }
void Awake() { XuanPanelInstance = this; }