예제 #1
0
        //Change the texture of the model based on the enemy code
        public void ChangeSkin(PowerUpTypes powerUpType)
        {
            switch (powerUpType)
            {
            case PowerUpTypes.DOUBLE_ATTACK:
                foreach (ModelMesh mesh in model.Meshes)
                {
                    foreach (BasicEffect effect in mesh.Effects)
                    {
                        effect.Texture = textures[0];
                    }
                }
                break;

            case PowerUpTypes.SPEED_ATTACK:
                foreach (ModelMesh mesh in model.Meshes)
                {
                    foreach (BasicEffect effect in mesh.Effects)
                    {
                        effect.Texture = textures[1];
                    }
                }
                break;

            default:
                break;
            }
        }
예제 #2
0
    private void I_ActivatePowerUp(object newPowerUp)
    {
        PowerUpTypes weapon = (PowerUpTypes)newPowerUp;

        switch (weapon)
        {
        case PowerUpTypes.SpeedBoost:
            _SpeedBoostTimer    = _speedBoostPresence;
            _isSpeedBoostActive = true;
            break;

        case PowerUpTypes.Shield:
            if (ShieldsAreActive == true)
            {
                return;
            }
            ShieldsAreActive = true;
            break;

        case PowerUpTypes.Health:
            _Event_AddHealth.Invoke(this);
            break;

        default:
            break;
        }
    }
예제 #3
0
    public void GetPowerUp()
    {
        currentPowerUp = (PowerUpTypes)Random.Range(0, System.Enum.GetValues(typeof(PowerUpTypes)).Length);

        switch (currentPowerUp)
        {
        case PowerUpTypes.regenarateHealth:

            playerHealth.Heal(healAmount);

            break;

        case PowerUpTypes.speedUp:

            StartCoroutine(playerMovement.SpeedUpForSeconds(playerMovement.Speed * speedIncrement, powerUpDuration));

            break;

        case PowerUpTypes.bubbleShield:

            StartCoroutine(playerHealth.GetBubbleShield(powerUpDuration));

            break;

        default:

            StartCoroutine(PowerUpDurationTimer());

            break;
        }
    }
예제 #4
0
    /// <summary>
    /// Returns a random power up.
    /// </summary>
    /// <returns>The power up game object.</returns>
    internal GameObject PickOne()
    {
        int          randomIndex = UnityEngine.Random.Range(0, Enum.GetNames(typeof(PowerUpTypes)).Length);
        PowerUpTypes powerUpType = (PowerUpTypes)randomIndex;

        return(getPowerUpPrefab(powerUpType));
    }
예제 #5
0
        private IEnumerator DestroyMatchedCells(IDictionary <ICell, IList <ICell> > matchedCellsDictionary)
        {
            foreach (var cellList in matchedCellsDictionary)
            {
                if (cellList.Key.CurrentGameObject != null)
                {
                    if (cellList.Value.Count > 3)
                    {
                        int matchCount = cellList.Value.Count;

                        _colorsList.Add(Helper.DetectColor(cellList.Key));

                        PowerUpTypes powerUp = Helper.DetectPowerUp(matchCount);
                        _spawnedPowerUpDictionary.Add(
                            new Vector3(cellList.Key.TargetX, cellList.Key.TargetY, 0f), powerUp);
                    }
                }

                WorkAfterMatch(cellList.Value);
            }

            _matchedCellsDictionary.Clear();

            yield return(new WaitForSeconds(StringsAndConst.TIME_AFTER_DESTROY));

            OnEvent(EventTypes.BOARD_EndDestroyMatchedCells, null);
        }
예제 #6
0
    public override void init()
    {
        base.init();

        dataManager = DataManager.instance;

        powerUpType = GetComponent <PowerUpObject>().powerUpType;
    }
예제 #7
0
        public GameObject SpawnPowerPrefab(PowerUpTypes powerUpType, Vector3 position)
        {
            GameObject powerGameObject = _objectStorage.GetPowerElement(powerUpType);

            _objectSetter.SetGameObject(powerGameObject, position);

            return(powerGameObject);
        }
        public override void Init()
        {
            base.Init();

            dataManager = DataManager.instance;

            powerUpType = GetComponent<PowerUpObject>().powerUpType;
        }
예제 #9
0
 public int GetPowerUpCost(PowerUpTypes powerUpType)
 {
     if (currentPowerupLevel[(int)powerUpType] < staticData.GetTotalPowerUpLevels())
     {
         return(staticData.GetPowerUpCost(powerUpType, currentPowerupLevel[(int)powerUpType]));
     }
     return(-1); // out of power up upgrades
 }
예제 #10
0
        // something has changed (item change, purchase, etc). Need to refresh the gui text
        public void RefreshStoreGUI()
        {
            int cost = -1;

            if (storeSelectingPowerUp)
            {
                PowerUpTypes powerUp = (PowerUpTypes)storeItemIndex;
                cost = dataManager.GetPowerUpCost(powerUp);
                storeBuyButton.SetActive(cost != -1);

                if (useuGUI)
                {
                    storeTitleText.text                  = dataManager.GetPowerUpTitle(powerUp);
                    storeDescriptionText.text            = dataManager.GetPowerUpDescription(powerUp);
                    storePowerUpSelectionButtonText.text = "Characters";
                }
                else
                {
#if COMPILE_NGUI
                    storeTitle.text                  = dataManager.GetPowerUpTitle(powerUp);
                    storeDescription.text            = dataManager.GetPowerUpDescription(powerUp);
                    storePowerUpSelectionButton.text = "Characters";
#endif
                }
            }
            else     // characters
            {
                cost = dataManager.GetCharacterCost(storeItemIndex);
                storeBuyButton.SetActive(cost != -1);

                if (useuGUI)
                {
                    storeTitleText.text                  = dataManager.GetCharacterTitle(storeItemIndex);
                    storeDescriptionText.text            = dataManager.GetCharacterDescription(storeItemIndex);
                    storePowerUpSelectionButtonText.text = "Power Ups";
                }
                else
                {
#if COMPILE_NGUI
                    storeTitle.text                  = dataManager.GetCharacterTitle(storeItemIndex);
                    storeDescription.text            = dataManager.GetCharacterDescription(storeItemIndex);
                    storePowerUpSelectionButton.text = "Power Ups";
#endif
                }
            }

            if (useuGUI)
            {
                storeCoinsText.text = string.Format("{0}  ({1} Coins Available)", (cost == -1 ? "Purchased" : string.Format("Cost: {0}", cost.ToString())), dataManager.GetTotalCoins(true));
            }
            else
            {
#if COMPILE_NGUI
                storeCoins.text = string.Format("{0}  ({1} Coins Available)", (cost == -1 ? "Purchased" : string.Format("Cost: {0}", cost.ToString())), dataManager.GetTotalCoins(true));
#endif
            }
        }
예제 #11
0
        public void Start()
        {
            gameManager = GameManager.instance;
            dataManager = DataManager.instance;
            gameManager.OnPauseGame += GamePaused;

            activePowerUp = PowerUpTypes.None;
            activePowerUpData = new CoroutineData();
        }
예제 #12
0
    void Start()
    {
        gameManager = GameManager.instance;
        dataManager = DataManager.instance;
        GameManager.instance.onPauseGame += gamePaused;

        activePowerUp     = PowerUpTypes.None;
        activePowerUpData = new CoroutineData();
    }
예제 #13
0
    IEnumerator Drope(GameObject nukeObject)
    {
        Transform  nukeDropPos = (this.tag == "Player1") ? GameObject.FindGameObjectWithTag("Player2").transform : GameObject.FindGameObjectWithTag("Player1").transform;
        GameObject tempNuke    = Instantiate(nukeObject, new Vector3(nukeDropPos.position.x, nukeDropPos.position.y + 10f, nukeDropPos.position.z), Quaternion.Euler(new Vector3(0, 0, 180f))) as GameObject;

        yield return(new WaitForSeconds(0.01f));

        pType = PowerUpTypes.None;
    }
예제 #14
0
        public PowerUp(Vector2 Position, PowerUpTypes PowerUpType)
        {
            this.Position    = Position;
            this.PowerUpType = PowerUpType;

            SpriteWidth  = 24;
            SpriteHeight = 24;
            Origin.Y     = 24;
            this.Mask    = PowerUp.ActiveMask;
        }
예제 #15
0
    public static UInt32?GetPowerUpUsesLeft(PowerUpTypes powerUp)
    {
        UInt32?usesLeft = null;

        if (powerUps.ContainsKey(powerUp))
        {
            usesLeft = powerUps[powerUp];
        }
        return(usesLeft);
    }
예제 #16
0
        public static PowerUpTypes DetectPowerUp(int matchCount)
        {
            PowerUpTypes powerUp = PowerUpTypes.None;

            if (matchCount >= 4)
            {
                powerUp = PowerUpTypes.Gravity;
            }

            return(powerUp);
        }
예제 #17
0
        public void DeactivatePowerUp()
        {
            if (activePowerUp == PowerUpTypes.None)
                return;

            // Be sure the coroutine is stopped, deactivate may be called before runPowerUp is finished
            StopCoroutine("RunPowerUp");
            gameManager.ActivatePowerUp(activePowerUp, false);
            activePowerUp = PowerUpTypes.None;
            activePowerUpData.duration = 0;
        }
예제 #18
0
    public static void AddToPowerUp(PowerUpTypes powerUp)
    {
        //This code is intended for debugging

        if (powerUps == null)
        {
            Initialise();
        }
        powerUps[powerUp]++;
        SaveChanges();
    }
예제 #19
0
 public void activatePowerUp(PowerUpTypes powerUpType, bool activate)
 {
     if (activate)
     {
         // deactivate the current power up (if a power up is active) and activate the new one
         powerUpManager.deactivatePowerUp();
         powerUpManager.activatePowerUp(powerUpType);
         audioManager.playSoundEffect(SoundEffects.PowerUpSoundEffect);
     }
     playerController.activatePowerUp(powerUpType, activate, dataManager.getPowerUpColor(powerUpType));
 }
예제 #20
0
 public void ActivatePowerUp(PowerUpTypes powerUpType, bool activate)
 {
     if (activate)
     {
         // deactivate the current power up (if a power up is active) and activate the new one
         powerUpManager.DeactivatePowerUp();
         powerUpManager.ActivatePowerUp(powerUpType);
         audioManager.PlaySoundEffect(SoundEffects.PowerUpSoundEffect);
     }
     playerController.ActivatePowerUp(powerUpType, activate);
     guiManager.ActivatePowerUp(powerUpType, activate, dataManager.GetPowerUpLength(powerUpType));
 }
예제 #21
0
        public void UpgradePowerUp(PowerUpTypes powerUpType)
        {
            // Can't upgrade if the player can't afford the power up
            int cost = dataManager.GetPowerUpCost(powerUpType);

            if (dataManager.GetTotalCoins(true) < cost)
            {
                return;
            }
            dataManager.UpgradePowerUp(powerUpType);
            dataManager.AdjustTotalCoins(-cost, true);
        }
예제 #22
0
    public void UsePowerUp(PowerUpTypes powerUp)
    {
        Debug.Log("UsePowerUp: " + powerUp.ToString());
        switch (powerUp)
        {
        case PowerUpTypes.EXTRA_TIME:
            ExtraTime(); break;

        case PowerUpTypes.GOLDEN_KNIFE:
            GoldenKnife(); break;
        }
    }
예제 #23
0
 void Start()
 {
     playerRB         = GetComponent <Rigidbody2D> ();
     anim             = GetComponent <Animator> ();
     spRenderer       = GetComponent <SpriteRenderer> ();
     canJumpTwice     = false;
     hasPowerUP       = false;
     pType            = PowerUpTypes.None;
     infected         = false;
     currentPlayerTag = gameObject.tag;
     OwnInvetorySlot  = (gameObject.tag == "Player1") ? GameManager.Instance.pOneInventorySlot : GameManager.Instance.PTwoInventorySlot;
 }
예제 #24
0
    public void deactivatePowerUp()
    {
        if (activePowerUp == PowerUpTypes.None)
        {
            return;
        }

        // Be sure the coroutine is stopped, deactivate may be called before runPowerUp is finished
        StopCoroutine("runPowerUp");
        gameManager.activatePowerUp(activePowerUp, false);
        activePowerUp = PowerUpTypes.None;
        activePowerUpData.duration = 0;
    }
예제 #25
0
        public static PowerUpTypes StringToPowerType(string powerTypeString)
        {
            PowerUpTypes powerUpType = PowerUpTypes.None;

            switch (powerTypeString)
            {
            case StringsAndConst.TAG_GRAVITY:
                powerUpType = PowerUpTypes.Gravity;
                break;
            }

            return(powerUpType);
        }
예제 #26
0
    public void upgradePowerUp(PowerUpTypes powerUpType)
    {
        // Can't upgrade if the player can't afford the power up
        int cost = dataManager.getPowerUpCost(powerUpType);

        if (dataManager.getTotalCoins() < cost)
        {
            return;
        }
        dataManager.upgradePowerUp(powerUpType);
        dataManager.adjustTotalCoins(-cost);
        guiManager.refreshStoreGUI();
    }
예제 #27
0
 public override void FromBytes(BinaryReader reader)
 {
     base.FromBytes(reader);
     Name            = reader.ReadString();
     Color           = reader.ReadByte();
     Position        = new Vector2(reader.ReadSingle(), reader.ReadSingle());
     Direction       = reader.ReadSingle();
     Speed           = reader.ReadSingle();
     TurretDirection = reader.ReadSingle();
     Health          = reader.ReadByte();
     Shield          = reader.ReadByte();
     ActivePowerUp   = (PowerUpTypes)reader.ReadByte();
 }
예제 #28
0
        public void SetPowerUp(PowerUpTypes p)
        {
            this.powerUpType = p;
            switch (p)
            {
            case PowerUpTypes.GLOCK:
                CreatePowerup("PUGlock");
                break;

            case PowerUpTypes.KATANA:
                CreatePowerup("PUKatana");
                break;
            }
        }
예제 #29
0
    /// <summary>
    /// Displaies the power up.
    /// </summary>
    /// <param name="type">The power up type.</param>
    /// <param name="duration">The duration of the power up.</param>
    public void DisplayPowerUp(PowerUpTypes type, float duration, string title)
    {
        if (title == "")
        {
            Debug.LogError("no title defined");
            return;
        }

        if (duration != -1)
        {
            title += " (" + duration + "s) !";
        }
        uiManager.ShowItemActivatedEventText(title, 3f);
    }
예제 #30
0
    /// <summary>
    /// Applies the power up.
    /// </summary>
    /// <param name="type">The power up type to apply.</param>
    /// <param name="duration">The duration of the power up.</param>
    public void ApplyPowerUp(PowerUpTypes type, float duration)
    {
        switch (type)
        {
        case PowerUpTypes.DoubledShotSpeed:
            StartCoroutine(DoubledShotSpeed(duration));
            break;

        case PowerUpTypes.HalfedShotSpeed:
            StartCoroutine(HalfedScore(duration));
            break;

        case PowerUpTypes.DoubledScore:
            StartCoroutine(DoubledScore(duration));
            break;

        case PowerUpTypes.HalfedScore:
            StartCoroutine(HalfedScore(duration));
            break;

        case PowerUpTypes.LiveUp:
            LiveUp();
            break;

        case PowerUpTypes.LiveDown:
            LiveDown();
            break;

        case PowerUpTypes.EnemySmaller:
            StartCoroutine(EnemySmaller(duration));
            break;

        case PowerUpTypes.EnemyBigger:
            StartCoroutine(EnemyBigger(duration));
            break;

        case PowerUpTypes.EnemyFreeze:
            StartCoroutine(EnemyFreeze(duration));
            break;

        case PowerUpTypes.EnemyDoubledSpeed:
            StartCoroutine(EnemyDoubledSpeed(duration));
            break;

        default:
            Debug.Log("PowerUp type not implemented");
            break;
        }
    }
예제 #31
0
    IEnumerator SwitchPos()
    {
        GameObject otherPlayer = (this.gameObject.tag != "Player1") ? GameObject.FindGameObjectWithTag("Player1") : GameObject.FindGameObjectWithTag("Player2") as GameObject;
        GameObject ownPlayer   = (this.gameObject.tag == "Player1") ? GameObject.FindGameObjectWithTag("Player1") : GameObject.FindGameObjectWithTag("Player2") as GameObject;

        Vector2 ownTransform   = ownPlayer.transform.position;
        Vector2 otherTransform = otherPlayer.transform.position;

        Debug.Log("Own : " + ownTransform + " Other : " + otherTransform);
        yield return(new WaitForSeconds(0.2f));

        pType = PowerUpTypes.None;
        otherPlayer.transform.position = new Vector2(ownTransform.x, ownTransform.y);
        ownPlayer.transform.position   = new Vector2(otherTransform.x, otherTransform.y);
    }
예제 #32
0
파일: World.cs 프로젝트: sing840722/FlyFly
        private void CreatePowerUp(int x, int y, PowerUpTypes powerUpType)
        {
            float waveZOffset = 6000;
            float waveYOffset = 6500;
            float waveOffset  = 30000;
            float pX          = 10;
            float pY          = y + y * waveYOffset;
            float pZ          = camera.Position.Z + (x + x * waveZOffset) - (waveIndex * waveOffset);

            PowerUp power = new PowerUp(powerUpType);

            power.Initialise();
            power.Position = new Vector3(pX, pY, pZ);
            powerUpManager.AddPowerUp(power);
        }
예제 #33
0
    IEnumerator ThrowSomething(GameObject mushroomObject)
    {
        GameObject tempMushroom = Instantiate(mushroomObject, mushroomThrowPoint.position, mushroomThrowPoint.rotation);

        tempMushroom.transform.localScale = transform.localScale;
        float xDirection = (transform.localScale.x > 0f) ? 1f : -1f;

        tempMushroom.GetComponent <Mushroom>().playerCtrl = this;
        tempMushroom.GetComponent <Rigidbody2D>().AddForce(new Vector2(xDirection * 500f, 250f));
        anim.SetTrigger("throw");

        yield return(new WaitForSeconds(0.3f));

        pType = PowerUpTypes.None;
    }
예제 #34
0
 /// <summary>
 /// Applies the power up.
 /// </summary>
 /// <param name="type">The power up type to apply.</param>
 /// <param name="duration">The duration of the power up.</param>
 public void ApplyPowerUp(PowerUpTypes type, float duration)
 {
     switch (type)
     {
         case PowerUpTypes.DoubledShotSpeed:
             StartCoroutine(DoubledShotSpeed(duration));
             break;
         case PowerUpTypes.HalfedShotSpeed:
             StartCoroutine(HalfedScore(duration));
             break;
         case PowerUpTypes.DoubledScore:
             StartCoroutine(DoubledScore(duration));
             break;
         case PowerUpTypes.HalfedScore:
             StartCoroutine(HalfedScore(duration));
             break;
         case PowerUpTypes.LiveUp:
             LiveUp();
             break;
         case PowerUpTypes.LiveDown:
             LiveDown();
             break;
         case PowerUpTypes.EnemySmaller:
             StartCoroutine(EnemySmaller(duration));
             break;
         case PowerUpTypes.EnemyBigger:
             StartCoroutine(EnemyBigger(duration));
             break;
         case PowerUpTypes.EnemyFreeze:
             StartCoroutine(EnemyFreeze(duration));
             break;
         case PowerUpTypes.EnemyDoubledSpeed:
             StartCoroutine(EnemyDoubledSpeed(duration));
             break;
         default:
             Debug.Log("PowerUp type not implemented");
             break;
     }
 }
예제 #35
0
 public string GetPowerUpTitle(PowerUpTypes powerUpType)
 {
     return powerUpTitle[(int)powerUpType];
 }
예제 #36
0
 public void ActivatePowerUp(PowerUpTypes powerUpType)
 {
     activePowerUp = powerUpType;
     activePowerUpData.duration = dataManager.GetPowerUpLength(powerUpType);
     StartCoroutine("RunPowerUp");
 }
예제 #37
0
 public string GetPowerUpDescription(PowerUpTypes powerUpType)
 {
     return powerUpDescription[(int)powerUpType];
 }
예제 #38
0
 public void ActivatePowerUp(PowerUpTypes powerUpType, bool activate)
 {
     if (powerUpType != PowerUpTypes.None) {
         ParticleSystem particleSystem = powerUpParticleSystem[(int)powerUpType];
         if (activate) {
             particleSystem.Play();
         } else {
             particleSystem.Stop();
         }
         if (powerUpType == PowerUpTypes.CoinMagnet) {
             coinMagnetTrigger.SetActive(activate);
         }
     }
 }
예제 #39
0
    /// <summary>
    /// Displaies the power up.
    /// </summary>
    /// <param name="type">The power up type.</param>
    /// <param name="duration">The duration of the power up.</param>
    public void DisplayPowerUp(PowerUpTypes type, float duration, string title)
    {
        if (title == "")
        {
            Debug.LogError("no title defined");
            return;
        }

        if (duration != -1)
            title += " (" + duration + "s) !";
        uiManager.ShowItemActivatedEventText(title, 3f);
    }
예제 #40
0
 /// <summary>
 /// Returns the prefab of the power up with the given type.
 /// </summary>
 /// <returns>The power up prefab.</returns>
 /// <param name="type">The type of the power up.</param>
 private GameObject getPowerUpPrefab(PowerUpTypes type)
 {
     string powerUpString = type.ToString();
     return Resources.Load("Prefabs/PowerUps/" + powerUpString) as GameObject;
 }
예제 #41
0
 public int getPowerUpLevel(PowerUpTypes powerUpTypes)
 {
     return currentPowerupLevel[(int)powerUpTypes];
 }
예제 #42
0
 public GameObject getPowerUpPrefab(PowerUpTypes powerUpType)
 {
     return staticData.getPowerUpPrefab(powerUpType);
 }
예제 #43
0
 public string getPowerUpTitle(PowerUpTypes powerUpType)
 {
     return staticData.getPowerUpTitle(powerUpType);
 }
예제 #44
0
    public void activatePowerUp(PowerUpTypes powerUpType, bool activate)
    {
        if (powerUpType != PowerUpTypes.None) {
            ParticleSystem particleSystem = powerUpParticleSystem[(int)powerUpType];
            if (activate) {
                particleSystem.Play();
            } else {
                particleSystem.Stop();
            }
            if (powerUpType == PowerUpTypes.CoinMagnet) {
#if UNITY_3_5
                coinMagnetTrigger.active = activate;
#else
			    coinMagnetTrigger.SetActive(activate);
#endif
            }
        }
    }
예제 #45
0
        public void ActivatePowerUp(PowerUpTypes powerUpType, bool active, float length)
        {
            if (active) {
                inGameActivePowerUpCutoffMaterial.SetFloat("_Cutoff", 0.0f);
            #if !(UNITY_4_3 || UNITY_4_4 || UNITY_4_5)
                if (useuGUI) {
                    inGameActivePowerUpImage.sprite = inGamePowerUpSprites[(int)powerUpType];
                } else {
            #endif
            #if COMPILE_NGUI
                    inGameActivePowerUp.spriteName = powerUpType.ToString();
            #endif
            #if !(UNITY_4_3 || UNITY_4_4 || UNITY_4_5)
                }
            #endif

                if (inGamePowerUpProgressWaitForSeconds == null) {
                    inGamePowerUpProgressWaitForSeconds = new WaitForSeconds(0.05f);
                }

                inGamePowerUpData.duration = length;
                StartCoroutine("UpdatePowerUpProgress");
            } else {
                StopCoroutine("UpdatePowerUpProgress");
            }
            #if !(UNITY_4_3 || UNITY_4_4 || UNITY_4_5)
            if (useuGUI) {
                inGameActivePowerUpImage.gameObject.SetActive(active);
            } else {
            #endif
            #if COMPILE_NGUI
                inGameActivePowerUp.gameObject.SetActive(active);
            #endif
            #if !(UNITY_4_3 || UNITY_4_4 || UNITY_4_5)
            }
            #endif
            powerUpActive = active;
        }
예제 #46
0
 public void ActivatePowerUp(PowerUpTypes powerUpType, bool activate)
 {
     if (activate) {
         // deactivate the current power up (if a power up is active) and activate the new one
         powerUpManager.DeactivatePowerUp();
         powerUpManager.ActivatePowerUp(powerUpType);
         audioManager.PlaySoundEffect(SoundEffects.PowerUpSoundEffect);
     }
     playerController.ActivatePowerUp(powerUpType, activate);
     guiManager.ActivatePowerUp(powerUpType, activate, dataManager.GetPowerUpLength(powerUpType));
 }
예제 #47
0
 public void UpgradePowerUp(PowerUpTypes powerUpType)
 {
     // Can't upgrade if the player can't afford the power up
     int cost = dataManager.GetPowerUpCost(powerUpType);
     if (dataManager.GetTotalCoins(true) < cost) {
         return;
     }
     dataManager.UpgradePowerUp(powerUpType);
     dataManager.AdjustTotalCoins(-cost, true);
 }
예제 #48
0
 public float getPowerUpLength(PowerUpTypes powerUpType)
 {
     return staticData.getPowerUpLength(powerUpType, currentPowerupLevel[(int)powerUpType]);
 }
예제 #49
0
 public int getPowerUpCost(PowerUpTypes powerUpType)
 {
     if (currentPowerupLevel[(int)powerUpType] < staticData.getTotalPowerUpLevels()) {
         return staticData.getPowerUpCost(powerUpType, currentPowerupLevel[(int)powerUpType]);
     }
     return -1; // out of power up upgrades
 }
예제 #50
0
 public void upgradePowerUp(PowerUpTypes powerUpType)
 {
     currentPowerupLevel[(int)powerUpType]++;
     PlayerPrefs.SetInt(string.Format("PowerUp{0}", (int)powerUpType), currentPowerupLevel[(int)powerUpType]);
 }
예제 #51
0
 public GameObject GetPowerUpPrefab(PowerUpTypes powerUpType)
 {
     return powerUpPrefab[(int)powerUpType];
 }
예제 #52
0
 public int GetPowerUpCost(PowerUpTypes powerUpType, int level)
 {
     return powerUpCost[((int)powerUpType * totalPowerUpLevels) + level];
 }
예제 #53
0
 public string getPowerUpDescription(PowerUpTypes powerUpType)
 {
     return staticData.getPowerUpDescription(powerUpType);
 }
예제 #54
0
 public float GetPowerUpLength(PowerUpTypes powerUpType, int level)
 {
     return powerUpLength[((int)powerUpType * (totalPowerUpLevels + 1)) + level];
 }
예제 #55
0
 public bool IsPowerUpActive(PowerUpTypes powerUpType)
 {
     return activePowerUp == powerUpType;
 }
예제 #56
0
    public void activatePowerUp(PowerUpTypes powerUpType, bool active, float length)
    {
        if (active) {
            inGameActivePowerUpCutoffMaterial.SetFloat("_Cutoff", 0.0f);
            inGameActivePowerUp.spriteName = powerUpType.ToString();

            if (inGamePowerUpProgressWaitForSeconds == null) {
                inGamePowerUpProgressWaitForSeconds = new WaitForSeconds(0.05f);
            }

            inGamePowerUpData.duration = length;
            StartCoroutine("updatePowerUpProgress");
        } else {
            StopCoroutine("updatePowerUpProgress");
        }
        inGameActivePowerUp.enabled = active;
        inGameActivePowerUpCutoff.enabled = active;
        powerUpActive = active;
    }