ShopMenu.Awake C# (CSharp) Méthode

Awake() public méthode

public Awake ( ) : void
Résultat void
    void Awake()
    {
        if (backButton.GetComponent<UIEventListener>() == null)
          backButton.gameObject.AddComponent<UIEventListener>();
        if (magnetButton.GetComponent<UIEventListener>() == null)
          magnetButton.gameObject.AddComponent<UIEventListener>();
        if (fartButton.GetComponent<UIEventListener>() == null)
          fartButton.gameObject.AddComponent<UIEventListener>();
        if (glideButton.GetComponent<UIEventListener>() == null)
          glideButton.gameObject.AddComponent<UIEventListener>();
        if (carrotSprayButton.GetComponent<UIEventListener>() == null)
          carrotSprayButton.gameObject.AddComponent<UIEventListener>();
        if (bubbleGumButton.GetComponent<UIEventListener>() == null)
          bubbleGumButton.gameObject.AddComponent<UIEventListener>();

        buttons = new UIImageButton[(int)UpgradeLevel.Type.Count];
        buttons[(int)UpgradeLevel.Type.Magnet] = magnetButton;
        buttons[(int)UpgradeLevel.Type.CarrotSpray] = carrotSprayButton;
        buttons[(int)UpgradeLevel.Type.BubbleGum] = bubbleGumButton;
        buttons[(int)UpgradeLevel.Type.PowerUpFart] = fartButton;
        buttons[(int)UpgradeLevel.Type.PowerUpGlide] = glideButton;
    }