private void ActivateGui(eActiveApp a_app) { m_activeApp = a_app; int num = (int)(a_app - 1); for (int i = 0; i < m_guis.Length; i++) { m_guis[i].SetActive(num == i); if (i < m_btnActiveRenderer.Length && null != m_btnActiveRenderer[i]) { m_btnActiveRenderer[i].enabled = (num == i); } } }
private void ActivateGui(eActiveApp a_app) { this.m_activeApp = a_app; int num = a_app - eActiveApp.home; for (int i = 0; i < this.m_guis.Length; i++) { this.m_guis[i].SetActive(num == i); if (i < this.m_btnActiveRenderer.Length && null != this.m_btnActiveRenderer[i]) { this.m_btnActiveRenderer[i].enabled = (num == i); } } }
private void Update() { float deltaTime = Time.deltaTime; if (m_curSin > -1f) { Vector3 b = Vector3.forward * m_zOffset; m_guiRoot.localPosition = Vector3.up * ((FastSin.Get(m_curSin * (float)Math.PI) - 1f) * 0.5f) + b; m_curSin += deltaTime * m_animSpeed; if (m_curSin > m_sinOffset + 1f) { m_curSin = -1f; Transform guiRoot = m_guiRoot; Vector3 up = Vector3.up; Vector3 localPosition = m_guiRoot.localPosition; guiRoot.localPosition = up * ((!(localPosition.y < -0.5f)) ? 0f : (-1f)) + b; } } eActiveApp eActiveApp = eActiveApp.none; if (Input.GetButtonDown("Communicator")) { SetVisible(!IsActive()); } else if (Input.GetButtonDown("Inventory") || Input.GetButtonDown("Exit")) { SetVisible(false); } else if (Input.GetButtonDown("Help")) { eActiveApp = eActiveApp.help; } else if (Input.GetButtonDown("Crafting")) { eActiveApp = eActiveApp.crafting; } else if (Input.GetButtonDown("Global Chat")) { eActiveApp = eActiveApp.chat; } else if (Input.GetButtonDown("Map")) { eActiveApp = eActiveApp.maps; } if (eActiveApp != 0) { if (m_activeApp == eActiveApp || !IsActive()) { SetVisible(!IsActive()); } ActivateGui(eActiveApp); } if (IsActive()) { eActiveApp activeApp = m_activeApp; if (activeApp == eActiveApp.home) { UpdateHomeApp(); } m_txtClock.text = m_dayNightCycle.GetTime(); if (null != m_client) { m_txtPlayerCount.text = LNG.Get("PLAYERCOUNT") + ": " + m_client.GetPlayerCount(); } } }
private void Update() { float deltaTime = Time.deltaTime; if (this.m_curSin > -1f) { Vector3 b = Vector3.forward * this.m_zOffset; this.m_guiRoot.localPosition = Vector3.up * ((FastSin.Get(this.m_curSin * 3.1415927f) - 1f) * 0.5f) + b; this.m_curSin += deltaTime * this.m_animSpeed; if (this.m_curSin > this.m_sinOffset + 1f) { this.m_curSin = -1f; this.m_guiRoot.localPosition = Vector3.up * ((this.m_guiRoot.localPosition.y >= -0.5f) ? 0f : -1f) + b; } } eActiveApp eActiveApp = eActiveApp.none; if (Input.GetButtonDown("Communicator")) { this.SetVisible(false == this.IsActive(true)); } else if (Input.GetButtonDown("Inventory") || Input.GetButtonDown("Exit")) { this.SetVisible(false); } else if (Input.GetButtonDown("Help")) { eActiveApp = eActiveApp.help; } else if (Input.GetButtonDown("Crafting")) { eActiveApp = eActiveApp.crafting; } else if (Input.GetButtonDown("Global Chat")) { eActiveApp = eActiveApp.chat; } else if (Input.GetButtonDown("Map")) { eActiveApp = eActiveApp.maps; } if (eActiveApp != eActiveApp.none) { if (this.m_activeApp == eActiveApp || !this.IsActive(true)) { this.SetVisible(false == this.IsActive(true)); } this.ActivateGui(eActiveApp); } if (this.IsActive(true)) { eActiveApp activeApp = this.m_activeApp; if (activeApp == eActiveApp.home) { this.UpdateHomeApp(); } this.m_txtClock.text = this.m_dayNightCycle.GetTime(); if (null != this.m_client) { this.m_txtPlayerCount.text = LNG.Get("PLAYERCOUNT") + ": " + this.m_client.GetPlayerCount(); } } }