コード例 #1
0
 private void OnMouseDown()
 {
     foreach (DefenderButton button in buttons)
     {
         button.GetComponent <SpriteRenderer>().color = new Color32(77, 77, 77, 255);
     }
     spriteRenderer.color = Color.white;
     defenderSpawner.SetSelectedDefender(defenderPrefab);
 }
コード例 #2
0
    private void OnMouseDown()
    {
        foreach (var button in _buttons)
        {
            button.SpriteRenderer.color = defaultColor;
        }

        spriteRenderer.color = Color.white;
        _defenderSpawner.SetSelectedDefender(defenderPrefab);
    }
コード例 #3
0
    private void OnMouseDown()
    {
        foreach (var defenderButton in FindObjectsOfType <DefenderButton>())
        {
            defenderButton.GetComponent <SpriteRenderer>().color = new Color32(102, 102, 102, 255);
        }

        GetComponent <SpriteRenderer>().color = Color.white;
        defenderSpawner.SetSelectedDefender(defenderPrefab);
    }
コード例 #4
0
    private void OnMouseDown()
    {
        foreach (DefenderButton button in defenderButtons)
        {
            button.spriteRenderer.color = new Color32(41, 41, 41, 255);
        }

        spriteRenderer.color = Color.white;
        defenderSpawner.SetSelectedDefender(defenderPrefab);
    }
コード例 #5
0
    private void OnMouseDown()
    {
        for (int i = 0; i < renderers.Length; i++)
        {
            renderers[i].color = grayed;
        }

        thisRenderer.color = white;

        defenderSpawner.SetSelectedDefender(defenderPrefab);
    }
コード例 #6
0
    // Define evento do mouse
    private void OnMouseDown()
    {
        // Reseta cor
        foreach (DefenderButton button in buttons)
        {
            button.spriteRenderer.color = defaultButtonColor;
        }

        spriteRenderer.color = Color.white;
        defenderSpawner.SetSelectedDefender(defenderPrefab);
    }
コード例 #7
0
    private void OnMouseDown()
    {
        var buttons = FindObjectsOfType <DefenderButton>();

        foreach (DefenderButton button in buttons)
        {
            button.GetComponent <SpriteRenderer>().color = Color.gray;
        }

        gameObject.GetComponent <SpriteRenderer>().color = Color.white;
        defenderSpawner.SetSelectedDefender(defenderPrefab);
    }
コード例 #8
0
    void OnMouseDown()
    {
        var buttons = FindObjectsOfType <DefenderButton>();

        foreach (var button in buttons)
        {
            button.GetComponent <SpriteRenderer>().color = new Color32(84, 84, 84, 255);
        }

        spriteRenderer.color = Color.white;
        defenderSpawner.SetSelectedDefender(defenderPrefab);
    }
コード例 #9
0
    private void OnMouseDown()
    {
        if (!LevelController.gameOver && !LevelController.gamePaused)
        {
            DefendersButtons.ResetButtons();
            spriteRenderer.color = Color.white;

            DefenderSpawner.SetSelectedDefender(defenderPrefab);

            // Play Sound
            AudioSource.PlayClipAtPoint(sounds.GetClip(0), transform.localPosition, PlayerPrefsController.GetMasterVolume());
        }
    }
コード例 #10
0
    private void OnMouseDown()
    {
        var buttons = FindObjectsOfType <DefenderButton>();

        foreach (DefenderButton button in buttons)
        {
            button.GetComponent <SpriteRenderer>().color = new Color32(144, 111, 111, 255);
        }
        GetComponent <SpriteRenderer>().color = Color.white;


        DefenderSpawner ds = FindObjectOfType <DefenderSpawner>();

        //Debug.Log("Defender Spawner found! ds == null? " + ds == null);
        ds.SetSelectedDefender(defenderPrefab);
    }
コード例 #11
0
    private void OnMouseDown()
    {
        if (!spriteRender)
        {
            return;
        }

        var buttons = FindObjectsOfType <DefenderButton>();

        foreach (DefenderButton button in buttons)
        {
            button.GetComponent <SpriteRenderer>().color = new Color32(75, 75, 75, 255);
        }

        spriteRender.color = Color.white;
        spawner.SetSelectedDefender(defenderPrefab);
    }
コード例 #12
0
    public void OnMouseDown()
    {
        if (!levelController.IsPaused())
        {
            // Only allow us to click the button if we have enough stars for it.
            if (sunDisplay.HaveEnoughSuns(cost))
            {
                ResetDisplay();

                spriteRenderer.color = Color.white;

                defenderSpawner.SetSelectedDefender(defenderPrefab);

                isClicked = true;
            }
        }
    }