// Use this for initialization
 void Awake()
 {
     GM = FindObjectOfType<GameManager>();
     GM.CreateBackground("Screens/screen_startExit");
     GM.CreateButton(0f, 0.2f, "UI/button_start", StartGame);
     GM.CreateButton(0f, 0f, "UI/button_exit", ExitGame);
     GM.CreateButton (0f, -0.2f, "UI/button_credits", GoCredits);
 }
Esempio n. 2
0
    public void Load(GameManager gameManager)
    {
        List<GameObject> tmp = new List<GameObject>();

        foreach (var component in heroes)
        {
            GameObject btmp = gameManager.CreateButton();
            Hero htmp = btmp.GetComponent<Hero>();
            htmp.cost = component.cost;
            htmp.amount = component.amount;
            htmp.dps = component.dps;
            htmp.name = component.name;
            htmp.baseCost = component.baseCost;
            htmp.baseDPS = component.baseDPS;
            tmp.Add(btmp);
        }
        gameManager.heroes = tmp;
    }