Exemplo n.º 1
0
 // Use this for initialization
 void Start()
 {
     ownedText = GameObject.Find("SimOwned").GetComponent <Text>();
     buySim    = GameObject.Find("SimButton").GetComponent <Button>();
     shop      = GameObject.Find("MainLogic").GetComponent <ShopStuff>();
     buySim.onClick.AddListener(Buy);
     buttonTooltip             = buySim.GetComponent <tooltips>();
     cash                      = GameObject.Find("MainLogic").GetComponent <Money>();
     buttonTooltip.tooltipText = "Increases score per tick by 1, Price: " + price;
     ownedText.text            = owned + string.Empty;
 }
Exemplo n.º 2
0
    public bool clickBlock(ShopStuff _shopStuff)
    {
        //Debug.Log("Click: " + _shopStuff.getNameTitle());

        if (_shopStuff.getPrice() > playerData.getMoney())
        {
            lvlNrInterfaceMnr.animatorMoneyNoEnoughStart();
            return(false);
        }
        else
        {
            playerData.takeMoney(_shopStuff.getPrice());
            lvlNrInterfaceMnr.refreshTextMoney();
            return(true);
        }
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        ach  = GameObject.Find("MainLogic").GetComponent <Achievemnts>();
        shop = GameObject.Find("MainLogic").GetComponent <ShopStuff>();
        mon  = GameObject.Find("MainLogic").GetComponent <Money>();
        sco  = GameObject.Find("MainLogic").GetComponent <scorer>();
        sim  = GameObject.Find("Sims").GetComponent <ShopSim>();
        Debug.Log(Application.persistentDataPath);
        fnv = GameObject.Find("FNV").GetComponent <Game>();
        poe = GameObject.Find("POE").GetComponent <Game>();
        r6  = GameObject.Find("R6").GetComponent <Game>();
        ds  = GameObject.Find("DS").GetComponent <Game>();
        pay = GameObject.Find("Payday2").GetComponent <Game>();
        sky = GameObject.Find("Skyrim").GetComponent <Game>();

        if (File.Exists(Application.persistentDataPath + "/gamesave.save"))
        {
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Open(Application.persistentDataPath + "/gamesave.save", FileMode.Open);
            Save            save = (Save)bf.Deserialize(file);
            file.Close();

            ach.first      = save.first;
            ach.second     = save.second;
            ach.third      = save.third;
            sim.owned      = save.simOwned;
            sim.price      = save.simPrice;
            shop.sModifier = save.sModifier;
            shop.mModifier = save.mModifier;
            shop.sAdd      = save.sAdd;
            shop.mAdd      = save.mAdd;
            sco.score      = save.score;
            mon.money      = save.money;
            if (save.fnv)
            {
                fnv.Activate();
            }
            if (save.r6)
            {
                r6.Activate();
            }
            if (save.poe)
            {
                poe.Activate();
            }
            if (save.ds)
            {
                ds.Activate();
            }
            if (save.pay)
            {
                pay.Activate();
            }
            if (save.sky)
            {
                sky.Activate();
            }
        }
        else
        {
            Debug.Log("F**k you, you ain't got a save");
        }
    }