예제 #1
0
        public IEnumerable <KeyValuePair <AnimationTimelineTrigger, TriggerActionDiscrete> > GetAudioStartTriggerActions()
        {
            var mam = SuperController.singleton.motionAnimationMaster;
            // mam.triggers is protected all through the code so, find the actions through the JSON
            var mamJSON = mam.GetJSON();

            try
            {
                foreach (var triggerJSON in mamJSON["triggers"].AsArray.Cast <SimpleJSON.JSONClass>())
                {
                    var trigger = new AnimationTimelineTrigger();
                    trigger.RestoreFromJSON(triggerJSON);
                    foreach (var actionJSON in triggerJSON["startActions"].AsArray.Cast <SimpleJSON.JSONClass>())
                    {
                        var action = new TriggerActionDiscrete();
                        action.RestoreFromJSON(actionJSON);

                        if (action.audioClip != null)
                        {
                            yield return(new KeyValuePair <AnimationTimelineTrigger, TriggerActionDiscrete>(trigger, action));
                        }
                    }
                }
            }
            finally { }
            yield break;
        }
 public override void RestoreFromJSON(JSONClass json)
 {
     _triggerActionDiscrete.RestoreFromJSON(json);
     _invokingJsonStorableAction.name = _triggerActionDiscrete.name;
 }