protected void DoPanelStuff() { if (toggle) { if (panelManager != null) { if (panelManager.CurrentPanel == panel) { panelManager.Dismiss(UIPanelManager.MENU_DIRECTION.Forwards); panelIsShowing = false; } else { panelManager.BringIn(panel); panelIsShowing = true; } } else { if (panelIsShowing) { panel.Dismiss(); } else { panel.BringIn(); } panelIsShowing = !panelIsShowing; } base.Value = panelIsShowing; } else { if (panelManager != null) { panelManager.BringIn(panel, UIPanelManager.MENU_DIRECTION.Forwards); } else { panel.BringIn(); } } }
public override void OnInput(ref POINTER_INFO ptr) { if (deleted) { return; } if (!m_controlIsEnabled || IsHidden()) { base.OnInput(ref ptr); return; } if (ptr.evt == whenToInvoke) { if (panelManager == null) { if (UIPanelManager.instance == null) { base.OnInput(ref ptr); return; } else { panelManager = UIPanelManager.instance; } // If we still have nothing, return: if (panelManager == null) { base.OnInput(ref ptr); return; } } if (detargetAllOthers) { UIManager.instance.DetargetAllExcept(ptr.id); } switch (changeType) { case ChangeType.BringIn: panelManager.BringIn(panel); break; case ChangeType.BringInImmediate: panelManager.BringInImmediate(panel); break; case ChangeType.BringInForward: panelManager.BringIn(panel, UIPanelManager.MENU_DIRECTION.Forwards); break; case ChangeType.BringInBack: panelManager.BringIn(panel, UIPanelManager.MENU_DIRECTION.Backwards); break; case ChangeType.Dismiss: if (panelManager.CurrentPanel != null) { if (string.Equals(panelManager.CurrentPanel.name, panel, System.StringComparison.CurrentCultureIgnoreCase)) { panelManager.Dismiss(UIPanelManager.MENU_DIRECTION.Forwards); } } break; case ChangeType.DismissCurrent: panelManager.Dismiss(UIPanelManager.MENU_DIRECTION.Forwards); break; case ChangeType.DismissImmediate: panelManager.DismissImmediate(UIPanelManager.MENU_DIRECTION.Forwards); break; case ChangeType.Toggle: if (panelManager != null && panelManager.CurrentPanel != null && string.Equals(panelManager.CurrentPanel.name, panel, System.StringComparison.CurrentCultureIgnoreCase)) { panelManager.Dismiss(UIPanelManager.MENU_DIRECTION.Forwards); } else { panelManager.BringIn(panel); } break; case ChangeType.Forward: panelManager.MoveForward(); break; case ChangeType.Back: panelManager.MoveBack(); break; } } base.OnInput(ref ptr); }
public override void OnInput(ref POINTER_INFO ptr) { if (deleted) { return; } base.OnInput(ref ptr); if (!m_controlIsEnabled || IsHidden()) { return; } if (panel == null) { return; } if (ptr.evt == whenToInvoke) { if (toggle) { if (panelManager != null) { if (panelManager.CurrentPanel == panel) { panelManager.Dismiss(UIPanelManager.MENU_DIRECTION.Forwards); panelIsShowing = false; } else { panelManager.BringIn(panel); panelIsShowing = true; } } else { if (panelIsShowing) { panel.StartTransition(UIPanelManager.SHOW_MODE.DismissForward); } else { panel.StartTransition(UIPanelManager.SHOW_MODE.BringInForward); } panelIsShowing = !panelIsShowing; } Value = panelIsShowing; } else { if (panelManager != null) { panelManager.BringIn(panel, UIPanelManager.MENU_DIRECTION.Forwards); } else { panel.StartTransition(UIPanelManager.SHOW_MODE.BringInForward); } } } }
public void DismissPanel() { panelManager.Dismiss(); }
public void PurchaseCancled() { // Back to the buy coins panel panelManager.Dismiss(); }
public IEnumerator DoSkill(int playerNum, bool canDoSkill, bool receiver) { if (IsNetWorking && !receiver) { networkView.RPC("DoSkill", RPCMode.Others, playerNum, canDoSkill, true); } SoundController.Instance.play_fireball_burning(); if (players[playerNum] == myPlayer) { skillCamera.backgroundColor = mySkillColor; } else { skillCamera.backgroundColor = oppoSkillColor; } energyNum[playerNum] = 0; if (players[playerNum] == myPlayer) { energyBar.Value = 0f; } myEnergyChange(); Vector3 footballVel = footBall.rigidbody.velocity; footBall.rigidbody.isKinematic = true; if (!canDoSkill) { energyNum[playerNum] = 50; if (players[playerNum] == myPlayer) { energyBar.Value = energyNum[playerNum] / 100f; } } yield return(new WaitForSeconds(0.1f)); // To make the football stop. moveFootballFromBody(playerNum); pannelManager.Dismiss(); mainCamera.enabled = false; guiCamera.enabled = false; gameState = GameState.Pause; if (canDoSkill) { skillCamera.SendMessage("PlayAnimateAround", players[playerNum].transform.position); } else { skillCamera.SendMessage("PlayAnimateQuick", players[playerNum].transform.position); } Time.timeScale = 0f; yield return(new WaitForSeconds(0.1f)); mainCamera.enabled = true; guiCamera.enabled = true; pannelManager.BringIn("BtnControllPanel"); gameState = GameState.Playing; if (canDoSkill) { SoundController.Instance.play_fireball_shoot(); Vector3 footballTarget = new Vector3(10f * (playerNum == 0 ? 1 : -1), 1f, 0f); footballDir = footballTarget - footBall.transform.position; footballDir.Normalize(); if (!IsNetWorking || Network.isServer) { StartCoroutine(FootballMoveTo(footballTarget, 40f)); } } else { footBall.rigidbody.isKinematic = false; footBall.rigidbody.velocity = footballVel; curCantDoSkill = false; } }