void Awake() { startWavePanel = GameObject.Find("WavePanel").GetComponent<UIInteractivePanel>(); startWaveButton = GameObject.Find("startWaveButton").GetComponent<UIButton>(); waveInfoPanel = GameObject.Find("WaveInfoPanel").GetComponent<UIPanel>(); waveInfoScrollList = GameObject.Find("WaveInfoScrollList").GetComponent<UIScrollList>(); waveInfoPanel.BringIn(); heroWaveManager = GameObject.Find("WaveManager").GetComponent<HeroWaveManager>(); heroWaveManager.onAllWaveEnemiesDefeated += HandleAllWaveEnemiesDefeated; heroWaveManager.onNextWaveReady += HandleOnNextWaveReady; heroWaveManager.onSpawnNewHero += HandleOnSpawnNewHero; waveButton = GameObject.Find("startWaveButton").GetComponent<tk2dSprite>(); waveButton.spriteId = waveButton.GetSpriteIdByName(waveStartButtonName); }
// Use this for initialization void Start() { repositoryLists = Flow.config.transform.FindChild("-Lists-").gameObject; scroll = Flow.config.GetComponent <ConfigManager>().inviteAllScroll; playingScroll = Flow.config.GetComponent <ConfigManager>().invitePlayingScroll; scroll.transform.parent = gameObject.transform; playingScroll.transform.parent = gameObject.transform; scroll.transform.localPosition = new Vector3(-0.7232132f, 0.7468368f, -7.011475f); playingScroll.transform.position = new Vector3(-0.7232132f, 0.7468368f, -7.011475f); UIInteractivePanel panel = GetComponent <UIInteractivePanel>(); panel.transitions.list[0].AddTransitionStartDelegate(EnteredInvite); panel.transitions.list[1].AddTransitionStartDelegate(EnteredInvite); inviteFriendPanel.GetComponent <UIInteractivePanel>().transitions.list[2].AddTransitionEndDelegate(SetInviteFriendsInactive); inviteFriendPanel.GetComponent <UIInteractivePanel>().transitions.list[0].AddTransitionEndDelegate(AddEmail); //searchText.SetFocusDelegate(ClearText); //searchText.AddValidationDelegate(TextChanged); ChangedAllPlaying(); // Find Friends Button if (Save.HasKey(PlayerPrefsKeys.FACEBOOK_TOKEN.ToString())) { findFriendsPanel.SetActive(false); } else { fb_account = new GameFacebook(handleLinkFacebook); } }
public override void OnInput(POINTER_INFO ptr) { if (null == this) { return; } if (!this.m_controlIsEnabled) { return; } if (this.inputDelegate != null) { this.inputDelegate(ref ptr); } POINTER_INFO.INPUT_EVENT evt = ptr.evt; switch (evt) { case POINTER_INFO.INPUT_EVENT.MOVE: if (this.panelManager == null) { this.panelManager = UIPanelManager.instance; } if (base.collider != null) { this.panelManager.MouseOverPanel = this; } if (this.m_panelState != UIInteractivePanel.STATE.OVER) { this.SetPanelState(UIInteractivePanel.STATE.OVER); } break; case POINTER_INFO.INPUT_EVENT.MOVE_OFF: case POINTER_INFO.INPUT_EVENT.RELEASE_OFF: if (base.collider != null) { RaycastHit raycastHit; if (!base.collider.Raycast(ptr.ray, out raycastHit, ptr.rayDepth)) { this.SetPanelState(UIInteractivePanel.STATE.NORMAL); if (this.panelManager == null) { this.panelManager = UIPanelManager.instance; } this.panelManager.MouseOverPanel = null; } else if (ptr.evt == POINTER_INFO.INPUT_EVENT.MOVE_OFF) { ptr.evt = POINTER_INFO.INPUT_EVENT.MOVE; } else { ptr.evt = POINTER_INFO.INPUT_EVENT.RELEASE; } } break; case POINTER_INFO.INPUT_EVENT.DRAG: if (this.draggable && !ptr.callerIsControl) { if (ptr.inputDelta.sqrMagnitude != 0f) { if (this.panelManager == null) { this.panelManager = UIPanelManager.instance; } if (base.collider != null) { this.panelManager.MouseOverPanel = this; } Plane plane = default(Plane); plane.SetNormalAndPosition(base.transform.forward * -1f, base.transform.position); float d; plane.Raycast(ptr.ray, out d); Vector3 vector = ptr.ray.origin + ptr.ray.direction * d; plane.Raycast(ptr.prevRay, out d); Vector3 b = ptr.prevRay.origin + ptr.prevRay.direction * d; vector = base.transform.position + base.transform.InverseTransformDirection(vector - b); if (this.constrainDragArea) { vector.x = Mathf.Clamp(vector.x, this.dragBoundaryMin.x, this.dragBoundaryMax.x); vector.y = Mathf.Clamp(vector.y, this.dragBoundaryMin.y, this.dragBoundaryMax.y); vector.z = Mathf.Clamp(vector.z, this.dragBoundaryMin.z, this.dragBoundaryMax.z); } base.transform.position = vector; if (this.twinFormID != G_ID.NONE) { UIInteractivePanel uIInteractivePanel = this.panelManager.FindPanel((int)this.twinFormID) as UIInteractivePanel; if (null != uIInteractivePanel) { plane = default(Plane); plane.SetNormalAndPosition(uIInteractivePanel.transform.forward * -1f, uIInteractivePanel.transform.position); plane.Raycast(ptr.ray, out d); vector = ptr.ray.origin + ptr.ray.direction * d; plane.Raycast(ptr.prevRay, out d); b = ptr.prevRay.origin + ptr.prevRay.direction * d; vector = uIInteractivePanel.transform.position + uIInteractivePanel.transform.InverseTransformDirection(vector - b); if (uIInteractivePanel.constrainDragArea) { vector.x = Mathf.Clamp(vector.x, uIInteractivePanel.dragBoundaryMin.x, uIInteractivePanel.dragBoundaryMax.x); vector.y = Mathf.Clamp(vector.y, uIInteractivePanel.dragBoundaryMin.y, uIInteractivePanel.dragBoundaryMax.y); vector.z = Mathf.Clamp(vector.z, uIInteractivePanel.dragBoundaryMin.z, uIInteractivePanel.dragBoundaryMax.z); } uIInteractivePanel.transform.position = vector; uIInteractivePanel.SetPanelState(UIInteractivePanel.STATE.DRAGGING); } } this.MoveChild(this.childFormID_0, this.childFormID_1); this.SetPanelState(UIInteractivePanel.STATE.DRAGGING); } } break; default: if (evt == POINTER_INFO.INPUT_EVENT.PRESS) { if (this.panelManager == null) { this.panelManager = UIPanelManager.instance; } if (base.collider != null) { this.panelManager.FocusPanel = this; this.panelManager.MouseOverPanel = this; } } break; } }