Ejemplo n.º 1
0
        /*------------------------------------------------------------------*\
        |*							PRIVATE METHODES
        \*------------------------------------------------------------------*/

        private void CreatePopup(float quantity, CollectibleType type)
        {
            var text     = $"+ {quantity} {type.ToString()}";
            var position = Helpers.SetY(entity.Position, Random.Range(2, 12));

            DrawingTools.TextPopup(text, position, 4f, 2f, 34, Colors.Primary);
        }
Ejemplo n.º 2
0
    public virtual void Collect()
    {
        Debug.Log(name + " collected ");
        Sound.DeathSound();

        GameObject       popUp = Instantiate(PopUpPrefab, transform.position, Quaternion.identity);
        PopUpScoreScript popp  = popUp.GetComponent <PopUpScoreScript>();

        popp._typeNPC   = Type.ToString();
        popp.minusScore = isBad;

        Destroy(this.gameObject);
    }
Ejemplo n.º 3
0
        private void CreatePopup(float quantity)
        {
            if (collectedType == CollectibleType.Structure)
            {
                return;
            }
            var sign     = quantity > 0 ? "+" : "-";
            var color    = quantity > 0 ? Colors.Primary : Colors.Secondary;
            var text     = $"{sign} {Math.Abs(quantity)} {collectedType.ToString()}";
            var position = Helpers.SetY(entity.Position, 2f);

            DrawingTools.TextPopup(text, position, 2f, 1f, color: color);
        }
Ejemplo n.º 4
0
    private void Awake()
    {
        if (PlayerPrefs.GetInt("FmodOn") > 0)
        {
            fmodOn = true;
        }

        if (GetComponent <PatrolCollectible>() != null)
        {
            _type = GetComponent <PatrolCollectible>().Type;
        }
        else
        {
            _type = GetComponent <BaseCollectible>().Type;
        }

        if (GetComponent <StudioEventEmitter>() == null)
        {
            _emitter = gameObject.AddComponent(typeof(StudioEventEmitter)) as StudioEventEmitter;
        }
        else
        {
            _emitter = GetComponent <StudioEventEmitter>();
        }


        if (fmodOn)
        {
            string idleSoundPath = "event:/SFX/" + _type.ToString() + "_idle";
            if (FMOD_Debug.CheckFmodEvent(idleSoundPath))
            {
                _emitter.Event = idleSoundPath;
                _emitter.Play();
            }
        }
    }
 public void UpdateStat(CollectibleType _colType, int count = 1)
 {
     availablePowerUps[_colType] += count;
     Debug.Log($"{_colType.ToString()} updated by {count}");
 }