Ejemplo n.º 1
0
    // Use this for initialization
    protected override void Start()
    {
        base.Start();

        //initialize variables from other sources (for communicating with managers, etc.)

        //check if we are already collected, depending on type
        bool doDisable = false;

        switch(type) {
            case ItemType.HealthUpgrade:
                doDisable = SlotInfo.IsHPModAcquired(bit) || LevelController.isTimeTrial;
                break;

            case ItemType.EnergyTank:
                if(bit == 0)
                    doDisable = SlotInfo.isSubTankEnergy1Acquired || LevelController.isTimeTrial;
                else
                    doDisable = SlotInfo.isSubTankEnergy2Acquired || LevelController.isTimeTrial;
                break;

            case ItemType.WeaponTank:
                if(bit == 0)
                    doDisable = SlotInfo.isSubTankWeapon1Acquired || LevelController.isTimeTrial;
                else
                    doDisable = SlotInfo.isSubTankWeapon2Acquired || LevelController.isTimeTrial;
                break;

            case ItemType.Armor:
                doDisable = SlotInfo.isArmorAcquired || LevelController.isTimeTrial;
                break;

            default:
                if(savePickUp) {
                    doDisable = SceneState.instance.CheckGlobalFlag(LevelController.levelPickupBitState, pickupBit);
                }
                break;
        }

        if(doDisable) {
            if(activator)
                activator.ForceActivate();
            gameObject.SetActive(false);
        }
    }