private void OnMouseDown()
 {
     if (TimeBonus != 0 && _roomTimer != null)
     {
         _roomTimer.ModTimer(TimeBonus);
     }
 }
Exemple #2
0
    private void OnMouseDown()
    {
        Debug.Log("Click on " + this.gameObject.name);

        if (DeactivateColliderOnClick)
        {
            Debug.Log("Deactivated collider for " + this.gameObject.name);
            this.GetComponent <Collider2D>().enabled = false;
        }

        if (ActivateGameobjects.Length > 0)
        {
            foreach (var go in ActivateGameobjects)
            {
                Debug.Log("Activating gameobject " + go.name);
                go.SetActive(true);
            }
        }

        if (DeactivateGameobjectOnClick)
        {
            Debug.Log("Deactivated gamobject " + this.gameObject.name);
            this.gameObject.SetActive(false);
        }

        if (TimeBonus != 0 && _roomTimer != null)
        {
            _roomTimer.ModTimer(TimeBonus);
        }
    }