void GetAvailability()
    {
        int heroSlotsLeft = GameMaster.BackpackSize - CharectorStats.numOfHeroes();

        if (greenOrPurple == true)
        {
            T1Available = InvManager.T1ShardNumCombo();
            if (T1Available > 10)
            {
                T1Available = 10;
            }
            if (T1Available > heroSlotsLeft)
            {
                T1Available = heroSlotsLeft;
            }
        }
        else
        {
            T2Available = InvManager.T2ShardNumCombo();
            if (T2Available > 10)
            {
                T2Available = 10;
            }
            if (T2Available > heroSlotsLeft)
            {
                T2Available = heroSlotsLeft;
            }
        }
    }
Esempio n. 2
0
 void Awake()
 {
     if (instance == null) //there is no instance, the instance will be assigned to this instance
     {                     //if there is an instance, another one will not be created (there will only be one instance)
         instance = this;
     }
 }
Esempio n. 3
0
 public static void LoadSplit(string Loadstr)
 {
     string[] tempLoad = Loadstr.Split('#');
     if (tempLoad.Length > 0)
     {
         WordDatav2.LoadManagerData(tempLoad[0]);
         InvManager.LoadManager(tempLoad[1]);
         CharectorStats.LoadManagerData(tempLoad[2]);
     }
 }
Esempio n. 4
0
 //Singleton
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Esempio n. 5
0
    public static string SaveParse()
    {
        string tempSave = "";

        tempSave += WordDatav2.SaveManagerData();
        tempSave += '#';
        tempSave += InvManager.SaveManager();
        tempSave += '#';
        tempSave += CharectorStats.SaveManagerData();
        return(tempSave);
    }
Esempio n. 6
0
 void Awake()
 {
     if (im == null)
     {
         DontDestroyOnLoad(gameObject);
         im = this;
     }
     else if (im != this)
     {
         Destroy(gameObject);
     }
 }
 void levelFinished()
 {
     GameMaster.lastCompletedLevel = GameMaster.Level;
     InvManager.GoldAdd(stagedGold);
     stagedGold = 0;
     InvManager.T1ShardAdd(stagedShard1);
     stagedShard1 = 0;
     InvManager.T2ShardAdd(stagedShard2);
     stagedShard2 = 0;
     WordDatav2.endOfLevelStats(region, difficulty, level, 10, 3);
     vicDefPanel.SetActive(true);
 }
    public void TestAddHeroClicked()
    {
        InvManager.GoldAdd(30);
        InvManager.T1ShardAdd(10);
        InvManager.T2ShardAdd(10);
        Debug.Log("current Inv:" + InvManager.GoldReturn().ToString() + " gold, " + InvManager.T1ShardAmount().ToString() + " T1s, " + InvManager.T2ShardAmount().ToString() + " T2s");
        for (int i = 0; i < CharectorStats.numOfHeroes(); i++)
        {
            var character = CharectorStats.UnlockedCharector(i);
            CharectorStats.testAddExp(i, 10);
        }

        SaveManager.SaveParse();
        //GameMaster.CallSave();
    }
    public void generateHeros()
    {
        gameObject.SetActive(false);
        confirmPanel.SetActive(false);
        int heroesToMake = (int)slider.value;


        if (greenOrPurple == true)
        {
            InvManager.CombineT1(heroesToMake);
        }
        else
        {
            InvManager.CombineT2(heroesToMake);
        }
        onHerosGenerated?.Invoke();
        // addedPanel.SetActive(true);
    }
Esempio n. 10
0
    private void Awake()
    {
        if (instance)
        {
            Destroy(gameObject);
            return;
        }
        instance = this;

        playerInventory = new Inventory(20, Inventory.InvType.PlayerInv);
        inventoryUI.Initialize(playerInventory);

        weaponSlot = new Inventory(1, Inventory.InvType.WeaponSlot);
        weaponSlotUI.Initialize(weaponSlot);

        equipmentSlots = new Inventory[equipmentSlotUI.Length];
        for (int i = 0; i < equipmentSlotUI.Length; i++)
        {
            equipmentSlots[i] = new Inventory(1, Inventory.InvType.EquipmentSlot);
            equipmentSlotUI[i].Initialize(equipmentSlots[i]);
        }
    }
Esempio n. 11
0
    // Start is called before the first frame update
    void Start()
    {
        gameController = GameObject.FindGameObjectWithTag("GameController");
        inv            = gameController.GetComponent <InvManager>();

        rb = GetComponent <Rigidbody>();

        rb.velocity = new Vector3(0.0f, -30.0f, 0.0f);

        if (towerName == "Tree")
        {
            rb.velocity = new Vector3(0.0f, -10.0f, 0.0f);
        }
        else if (towerName == "Pump" || towerName == "Drill")
        {
            isFactory = true;


            BoxCollider colid = GetComponent <BoxCollider>();
            colid.size = new Vector3(colid.size.x, colid.size.y - 0.9f, colid.size.z);
        }

        SetTexture();
    }
 private void OnEnable()
 {
     goldText.text = InvManager.GoldReturn().ToString();
 }
Esempio n. 13
0
    //public SetUVs Set_UVs;

    void Start()
    {
        Controller = GameObject.FindGameObjectWithTag("GameController");
        inv        = Controller.GetComponent <InvManager>();
        SetTileType(transform.position.y);
    }