Exemplo n.º 1
0
    protected override void Awake()
    {
        base.Awake();

        if (bgm == null)
        {
            var bgmPlayer = new GameObject("BgmPlayer");
            bgmPlayer.transform.SetParent(transform);
            bgm = bgmPlayer.AddComponent <BgmPlayer>();
        }

        if (se == null)
        {
            var sePlayer = new GameObject("SePlayer");
            sePlayer.transform.SetParent(transform);
            se = sePlayer.AddComponent <SePlayer>();
        }

        if (mixer == null)
        {
            var audiomixer = new GameObject("MixerController");
            audiomixer.transform.SetParent(transform);
            mixer = audiomixer.AddComponent <MixerController>();
        }
    }
Exemplo n.º 2
0
 void OnSelect()
 {
     mixer           = GameObject.Find("Mixer");
     mixerController = mixer.GetComponent <MixerController>();
     instrumentName  = transform.parent.name;
     mixerController.MuteTrack(instrumentName);
 }
Exemplo n.º 3
0
    // Use this for initialization
    protected virtual void Start( )
    {
        mixerController = FindObjectOfType <MixerController> ( );
        if (mixerController == null)
        {
            Debug.LogError("Cannot find mixer controller.");
        }
        else
        {
            mixerController.AddMe(this);
        }

        currentFillAmount = 0.0f;

        if (rends.Length == 0)
        {
            mats = new Material [1];
            if (debug)
            {
                Debug.Log(mats.Length);
            }
            mats [0] = GetComponent <Renderer> ( ).material;
        }
        else
        {
            mats = new Material [rends.Length];
            if (debug)
            {
                Debug.Log(mats.Length);
            }
            for (int i = 0; i < mats.Length; i++)
            {
                mats [i] = rends [i].material;
            }
        }
    }
Exemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     mixer = GetComponent <MixerController>();
 }