Beispiel #1
0
    static void FeedTargets(ICanSendAudio source, List <ICanReceiveAudio> targets)
    {
        foreach (var target in targets)
        {
            target.Feed(source.Spit());

            var nextSource = (target as MonoBehaviour).GetComponent <ICanSendAudio> ();
            if (nextSource != null)
            {
                FeedTargets(nextSource, nextSource.GetTargets());
            }
        }
    }
Beispiel #2
0
 void Awake()
 {
     source = GetComponent <ICanSendAudio> ();
 }