Beispiel #1
0
    private void Update()
    {
        if (nearbyEnemies.Count > 0)
        {
            if (!nearbyEnemies[currentFocusIndex].isAlive)
            {
                nearbyEnemies.Remove(nearbyEnemies[currentFocusIndex]);
                return;
            }
            UpdateFocus();

            //Enable graphics
            if (!targetAnimation.isActive)
            {
                targetAnimation.EnableObject(0.4f);
            }
        }
        else
        {
            if (targetAnimation.isActive)
            {
                targetAnimation.DisableObject(0.5f);
            }
        }
    }
Beispiel #2
0
 public void EnableOutline()
 {
     if (animatedObjectActiveHandler != null)
     {
         animatedObjectActiveHandler.EnableObject(transitionTime_IN);
         isEnabled = true;
     }
 }
Beispiel #3
0
    IEnumerator ShowCoinCountForSeconds(float s)
    {
        //show
        coinCanvasAnimator.EnableObject(AnimatedObjectActiveHandler.TweenType.Scale, 1f, Curves.Instance.Overshoot);
        yield return(new WaitForSecondsRealtime(s));

        coinCanvasAnimator.DisableObject(AnimatedObjectActiveHandler.TweenType.Scale, 0.5f, Curves.Instance.SmoothInOut);
    }
Beispiel #4
0
    public void ToggleMenu()
    {
        if (isOpen || !DialogueManager.DialogueActive)
        {
            menuOpen = !menuOpen;
            isOpen   = menuOpen;
            if (menuOpen)
            {
                source.clip = Open;

                source.Play(0);
                MenuOpenSound.Post(gameObject);
                MenuRTPC.SetGlobalValue(100f);
                GameManager.Instance.gameSpeedHandler.PauseGameSpeed(gameObject.GetInstanceID());
                GameManager.Instance.BlurCam();

                QuestBox.EnableObject(0.5f);
#if UNITY_STANDALONE
                PlayerManager.Instance.cameraScript.FreezeAndShowCursor(true, gameObject);
                ControlsBox.EnableObject(0.5f);
#endif
            }
            else
            {
                source.clip = Close;
                source.Play(0);
                MenuCloseSound.Post(gameObject);
                MenuRTPC.SetGlobalValue(0f);
                GameManager.Instance.gameSpeedHandler.UnPauseGameSpeed(gameObject.GetInstanceID());
                GameManager.Instance.UnBlurCam();
                QuestBox.DisableObject(0.25f);
#if UNITY_STANDALONE
                PlayerManager.Instance.cameraScript.FreezeAndShowCursor(false, gameObject);
                ControlsBox.DisableObject(0.25f);
#endif
            }

            if (OnMenuStateChange != null)
            {
                OnMenuStateChange(menuOpen);
            }

            OnMenuDown.Invoke(menuOpen);
        }
    }
Beispiel #5
0
    public void ToggleMenu()
    {
        if (isOpen || !DialogueManager.DialogueActive)
        {
            menuOpen = !menuOpen;
            isOpen   = menuOpen;
            if (menuOpen)
            {
                // HINT: Play menu open sound here
                source.PlayOneShot(openSound, vol);
                GameManager.Instance.gameSpeedHandler.PauseGameSpeed(gameObject.GetInstanceID());
                GameManager.Instance.BlurCam();

                QuestBox.EnableObject(0.5f);
#if UNITY_STANDALONE
                PlayerManager.Instance.cameraScript.FreezeAndShowCursor(true, gameObject);
                ControlsBox.EnableObject(0.5f);
#endif
            }
            else
            {
                // HINT: Play menu close sound here
                source.PlayOneShot(closeSound, vol);
                GameManager.Instance.gameSpeedHandler.UnPauseGameSpeed(gameObject.GetInstanceID());
                GameManager.Instance.UnBlurCam();
                QuestBox.DisableObject(0.25f);
#if UNITY_STANDALONE
                PlayerManager.Instance.cameraScript.FreezeAndShowCursor(false, gameObject);
                ControlsBox.DisableObject(0.25f);
#endif
            }

            if (OnMenuStateChange != null)
            {
                OnMenuStateChange(menuOpen);
            }

            OnMenuDown.Invoke(menuOpen);
        }
    }