Ejemplo n.º 1
0
 private void Fire()
 {
     if (Input.GetButtonDown(m_Input.GetFire()))
     {
         Scr_EventManager.TriggerEvent("Fire_Projectile");
     }
 }
Ejemplo n.º 2
0
    public static void UpdateScore(GameObject player, int amount)
    {
        int currentScore = 0;

        if (Instance.m_ScoreDictionary.TryGetValue(player.name, out currentScore))
        {
            currentScore += amount;
            if (currentScore < 0)
            {
                currentScore = 0;
            }

            Instance.m_ScoreDictionary[player.name] = currentScore;
        }
        else
        {
            if (amount < 0)
            {
                amount = 0;
            }
            Instance.m_ScoreDictionary.Add(player.name, amount);
        }

        Scr_EventManager.TriggerEvent("Update_Scores");
    }
Ejemplo n.º 3
0
    private void OnDisable()
    {
        Scr_EventManager.StopListening("Update_Scores", UpdateScoreUI);
        Scr_EventManager.StopListening("PowerupUpdate", UpdatePowerupIcons);

        Scr_EventManager.StopListening("Mom_Comes", ShowMomTimer);
        Scr_EventManager.StopListening("Mom_In_Room", ResetMomTimer);
    }
Ejemplo n.º 4
0
 private void OnDisable()
 {
     Scr_EventManager.StopListening("Mom_Comes", () => {
         if (m_Input != null)
         {
             m_Input.VibrateIncrease(0.1f, 0.3f, 5.0f);
         }
     });
 }
    public bool PickupPowerup(Scr_PowerUp.Type type)
    {
        if (m_HeldPowerup == Scr_PowerUp.Type.Empty)
        {
            m_HeldPowerup = type;
            Scr_EventManager.TriggerEvent("PowerupUpdate");
            return(true);
        }

        return(false);
    }
    public void ResetPlayerState()
    {
        gameObject.GetComponent <Scr_CharacterController>().SetSpeed(m_OriginalSpeed);
        gameObject.GetComponent <Scr_CharacterController>().SetMaxJumps(m_OriginalNrOfMaxJumps);
        gameObject.GetComponent <Scr_Combat>().SetPunchingPower(m_OriginalPunchingPower);
        m_PowerupTimer  = m_OriginalPowerupTimer;
        m_HeldPowerup   = Scr_PowerUp.Type.Empty;
        m_MustCountDown = false;

        m_SpeedParticle.SetActive(false);
        m_PowerParticle.SetActive(false);

        Scr_EventManager.TriggerEvent("PowerupUpdate");
    }
Ejemplo n.º 7
0
    // Update is called once per frame
    private void Update()
    {
        if (m_GameTime > 0.0f)
        {
            m_GameTime -= Time.deltaTime;
        }

        if (m_MomTimer >= 0.0f)
        {
            m_MomTimer -= Time.deltaTime;
        }

        if (m_MomTimer < m_MomComingTime && !m_IsWarningFired)
        {
            Scr_EventManager.TriggerEvent("Mom_Comes");
            Scr_AudioManager.Play("Suspense");
            m_IsWarningFired = true;

            m_SafeArrow.SetActive(true);
        }

        if (m_MomTimer < 0.0f)
        {
            if (!m_IsMomInRoom)
            {
                Scr_EventManager.TriggerEvent("Mom_In_Room");
                m_MomTimer    = m_MomStayTime;
                m_IsMomInRoom = true;
                m_SafeArrow.SetActive(false);
            }
            else
            {
                Scr_EventManager.TriggerEvent("Mom_Is_Leaving");
                SetRandomMomTimer();
                m_IsMomInRoom    = false;
                m_IsWarningFired = false;
            }
        }
    }