//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * Redefined Method: Update //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public void Update() { m_MovementClass.Update(); // Destroy Self if Finished if (m_MovementClass.HasReachedDestination()) { DestroyImmediate(gameObject); } else { // Set Position transform.localPosition = m_MovementClass.GetCurrentPosition(); // Change Alpha for Score Color LabelColour = GetComponent <UILabel>().color; LabelColour.a = (1.0f - m_MovementClass.GetTimeInstance().GetCompletionPercentage()); GetComponent <UILabel>().color = LabelColour; } }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Update Pause Transition //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ private void UpdatePauseTransition() { GameObject oPauseScreen = GetComponent <PauseScreenObjectsHolder>().m_PauseScreenPanel.Panel; GameObject oPlayer = GetComponent <PauseScreenObjectsHolder>().m_PlayerHolder.PlayerParent; if (m_ePauseState == PauseState.JUST_ACTIVATED) { m_MBOTPauseScreenHiddenToVisible.Update(); m_MBOTPlayerHiddenToVisible.Update(); oPauseScreen.transform.localPosition = m_MBOTPauseScreenHiddenToVisible.GetCurrentPosition(); oPlayer.transform.localPosition = m_MBOTPlayerHiddenToVisible.GetCurrentPosition(); m_VignetteObject.GetComponent <UISprite>().alpha = m_MBOTPauseScreenHiddenToVisible.GetTimeInstance().GetCompletionPercentage(); if (m_MBOTPauseScreenHiddenToVisible.HasReachedDestination() && m_MBOTPlayerHiddenToVisible.HasReachedDestination()) { m_MBOTPauseScreenHiddenToVisible.Reset(); m_MBOTPlayerHiddenToVisible.Reset(); ChangeState(); } } else { m_MBOTPauseScreenVisibleToHidden.Update(); m_MBOTPlayerVisibleToHidden.Update(); oPauseScreen.transform.localPosition = m_MBOTPauseScreenVisibleToHidden.GetCurrentPosition(); oPlayer.transform.localPosition = m_MBOTPlayerVisibleToHidden.GetCurrentPosition(); m_VignetteObject.GetComponent <UISprite>().alpha = 1.0f - m_MBOTPauseScreenVisibleToHidden.GetTimeInstance().GetCompletionPercentage(); if (m_MBOTPauseScreenVisibleToHidden.HasReachedDestination() && m_MBOTPlayerVisibleToHidden.HasReachedDestination()) { m_MBOTPauseScreenVisibleToHidden.Reset(); m_MBOTPlayerVisibleToHidden.Reset(); ChangeState(); } } }