Beispiel #1
0
 private void Awake()
 {
     if ((metagame_ = Metagame.GetInstance()) == null)
     {
         this.enabled = false;
         return;
     }
 }
Beispiel #2
0
    public static Metagame GetInstance()
    {
        if (instance_ == null)
        {
            GameObject metagameObject = GameObject.FindGameObjectWithTag("Metagame");

            if ((metagameObject == null) || ((instance_ = metagameObject.GetComponent<Metagame>()) == null))
            {
                Debug.LogError("Couldn't locate a GO with the \"Metagame\" tag or it's missing the Metagame script.");
                return null;
            }
        }

        return instance_;
    }
Beispiel #3
0
 public void SetMetagame(Metagame metagame)
 {
     metagame_ = metagame;
 }
Beispiel #4
0
    private void Awake()
    {
        if ((metagame_ = Metagame.GetInstance()) == null)
        {
            this.enabled = false;
            return;
        }

        SetState(PingReceiverState.Awake);
    }
Beispiel #5
0
 // Get Metagame types from costumeSelected and upgradeSelected
 private void GetSelectedMetagameCostume(out Metagame.UpgradeItems costumeUpgrade, out Metagame.Item metagameUpgrade)
 {
     if (costumeSelected == 1) {
         if (upgradeSelected == 1) {
             costumeUpgrade = Metagame.UpgradeItems.COSTUME1_UPGRADE0;
             metagameUpgrade = Metagame.costume1_upgrade0;
         }
         else if (upgradeSelected == 2) {
             costumeUpgrade = Metagame.UpgradeItems.COSTUME1_UPGRADE1;
             metagameUpgrade = Metagame.costume1_upgrade1;
         }
         else {
             costumeUpgrade = Metagame.UpgradeItems.COSTUME1_UPGRADE2;
             metagameUpgrade = Metagame.costume1_upgrade2;
         }
     }
     else if (costumeSelected == 2) {
         if (upgradeSelected == 1) {
             costumeUpgrade = Metagame.UpgradeItems.COSTUME2_UPGRADE0;
             metagameUpgrade = Metagame.costume2_upgrade0;
         }
         else if (upgradeSelected == 2) {
             costumeUpgrade = Metagame.UpgradeItems.COSTUME2_UPGRADE1;
             metagameUpgrade = Metagame.costume2_upgrade1;
         }
         else {
             costumeUpgrade = Metagame.UpgradeItems.COSTUME2_UPGRADE2;
             metagameUpgrade = Metagame.costume2_upgrade2;
         }
     }
     else if (costumeSelected == 3) {
         if (upgradeSelected == 1) {
             costumeUpgrade = Metagame.UpgradeItems.COSTUME3_UPGRADE0;
             metagameUpgrade = Metagame.costume3_upgrade0;
         }
         else if (upgradeSelected == 2) {
             costumeUpgrade = Metagame.UpgradeItems.COSTUME3_UPGRADE1;
             metagameUpgrade = Metagame.costume3_upgrade1;
         }
         else {
             costumeUpgrade = Metagame.UpgradeItems.COSTUME3_UPGRADE2;
             metagameUpgrade = Metagame.costume3_upgrade2;
         }
     }
     else {
         if (upgradeSelected == 1) {
             costumeUpgrade = Metagame.UpgradeItems.COSTUME4_UPGRADE0;
             metagameUpgrade = Metagame.costume4_upgrade0;
         }
         else if (upgradeSelected == 2) {
             costumeUpgrade = Metagame.UpgradeItems.COSTUME4_UPGRADE1;
             metagameUpgrade = Metagame.costume4_upgrade1;
         }
         else {
             costumeUpgrade = Metagame.UpgradeItems.COSTUME4_UPGRADE2;
             metagameUpgrade = Metagame.costume4_upgrade2;
         }
     }
 }
Beispiel #6
0
 public static bool IsUpgradeUnlocked(Metagame.Item item)
 {
     return item.unlockLevel <= CurrentLevel();
 }
Beispiel #7
0
 public static bool HasItem(Metagame.ConsumableUnlocked item)
 {
     return ((int)consumableUnlocked & (int)item) != 0;
 }
Beispiel #8
0
 public static bool HasItem(Metagame.UpgradeItems item)
 {
     return ((int)upgradeItems & (int)item) != 0;
 }