Exemplo n.º 1
0
    public void PlayFollowObject(SFXType i_Type, Transform i_parents)
    {
        if (sfxDictionary.ContainsKey(i_Type))
        {
            foreach (SoundEffect SFX in sfxDictionary[i_Type])
            {
                if (SFX.Available)
                {
                    SFX.Available = false;
                    SFX.PlayFollowObject(i_parents);
                    StartCoroutine(WaitForReturnList(SFX));
                    return;
                }
            }

            //If the SFX all are not available, create a new one
            CreateNewSFX(i_Type, sfxDictionary[i_Type]).PlayFollowObject(i_parents);
            return;
        }

        string message = "No SFX Found for " + i_Type + ". Please add.";

        Debug.LogFormat("<color=#0000FF>" + message + "</color>");
    }