Esempio n. 1
0
        public override string GetLabelText()
        {
            var         commandProp = CommandItem.CommandProperty;
            SignalAsset signalAsset = commandProp.GetChildProperty("target").GetProperty().objectReferenceValue as SignalAsset;

            return($"シグナルの待ち受け:{(signalAsset != null ? signalAsset.name : "")}");
        }
Esempio n. 2
0
 void AssignSignalAsset(SignalAsset newAsset)
 {
     foreach (var o in targets)
     {
         var signalEmitter = (SignalEmitter)o;
         TimelineUndo.PushUndo(signalEmitter, Styles.UndoCreateSignalAsset);
         signalEmitter.asset = newAsset;
     }
 }
Esempio n. 3
0
 void AssignSignalAsset(SignalAsset newAsset)
 {
     foreach (var o in targets)
     {
         var signalEmitter = (SignalEmitter)o;
         Undo.RegisterCompleteObjectUndo(signalEmitter, Styles.UndoCreateSignalAsset);
         signalEmitter.asset = newAsset;
     }
 }
Esempio n. 4
0
 void AssignSignalAsset(SignalAsset newAsset)
 {
     foreach (var o in targets)
     {
         var signalEmitter = (SignalEmitter)o;
         UndoExtensions.RegisterMarker(signalEmitter, Styles.UndoCreateSignalAsset);
         signalEmitter.asset = newAsset;
     }
 }
Esempio n. 5
0
 public static void AddNewReaction(this SignalReceiver receiver, SignalAsset signalAsset)
 {
     if (signalAsset != null && receiver != null)
     {
         Undo.RecordObject(receiver, Styles.UndoAddReaction);
         var newEvent = new UnityEvent();
         newEvent.AddPersistentListener();
         var evtIndex = newEvent.GetPersistentEventCount() - 1;
         newEvent.RegisterVoidPersistentListenerWithoutValidation(evtIndex, receiver.gameObject, string.Empty);
         receiver.AddReaction(signalAsset, newEvent);
         PrefabUtility.RecordPrefabInstancePropertyModifications(receiver);
     }
 }
Esempio n. 6
0
        public static void AddNewReaction(this SignalReceiver receiver, SignalAsset signalAsset)
        {
            if (signalAsset != null && receiver != null)
            {
                Undo.RegisterCompleteObjectUndo(receiver, Styles.UndoAddReaction);

                var newEvent = new UnityEvent();
                newEvent.AddPersistentListener();
                var evtIndex = newEvent.GetPersistentEventCount() - 1;
                newEvent.RegisterVoidPersistentListenerWithoutValidation(evtIndex, receiver.gameObject, string.Empty);
                receiver.AddReaction(signalAsset, newEvent);
            }
        }
Esempio n. 7
0
 static int FindIdForSignal(SerializedProperty signals, SignalAsset signalToFind)
 {
     for (var i = 0; i < signals.arraySize; ++i)
     {
         //signal in the receiver that matches the current signal asset will be displayed first
         var serializedProperty   = signals.GetArrayElementAtIndex(i);
         var signalReferenceValue = serializedProperty.objectReferenceValue;
         var signalToFindRefValue = signalToFind;
         if (signalReferenceValue != null && signalReferenceValue == signalToFindRefValue)
         {
             return(i);
         }
     }
     return(-1);
 }
    static void LoadSignalAssetsToTimeline()
    {
        if (m_timelineAsset == null)
        {
            return;
        }

        UpdateTrackAsset();

        foreach (var m in m_trackAsset.GetMarkers())
        {
            m_trackAsset.DeleteMarker(m);
        }

        List <ScriptableObject> list = new List <ScriptableObject>();
        string path = EditorUtils.DisplayFolderPanel("Load signals");

        if (path == "")
        {
            return;
        }
        EditorUtils.GetUnityObjectsOfTypeFromPath(path, list);

        Debug.Log(list.Count);

        TextAsset        jsonTxt = EditorUtils.GetJson(path);
        SingleSignalData json    = SingleSignalData.CreateFromJSON(jsonTxt.text);

        Debug.Log(json.signalList.Count);
        for (int i = 0; i < list.Count; i++)
        {
            SignalAsset signal = list[i] as SignalAsset;
            SignalData  data   = json.signalList[signal.name];
            //Debug.Log(data.time);

            SignalEmitter emitter = m_trackAsset.CreateMarker <SignalEmitter>(data.time);
            emitter.name  = signal.name;
            emitter.asset = signal;
        }
    }
Esempio n. 9
0
 void Register(SignalAsset a)
 {
     m_assets.Add(a);
 }
 public void SetSignalContext(SignalAsset assetContext = null)
 {
     signalAssetContext = assetContext;
     dirty = true;
 }
Esempio n. 11
0
 public static bool IsSignalAssetHandled(this SignalReceiver receiver, SignalAsset asset)
 {
     return(receiver != null && asset != null && receiver.GetRegisteredSignals().Contains(asset));
 }
 internal void SetAssetContext(SignalAsset asset)
 {
     m_TreeView.SetSignalContext(asset);
 }
 protected override void OnSignal(SignalAsset signal)
 {
     OnSignalTriggered?.Invoke(signal as TestSignal);
 }
 protected virtual void OnSignal(SignalAsset signal)
 {
 }
 public void _OnSignal(SignalAsset signal)
 {
     //Debug.Log(signal.name);
     OnSignal(signal);
 }