private void CreateEdges(Node srcNode, Node dstNode, TransitionEditionContext context) { if (srcNode == null || dstNode == null) { return; } string key = Graph.GenerateConnectionKey(srcNode, dstNode); if (this.m_ConnectedSlotsCache.ContainsKey(key)) { this.m_ConnectedSlotsCache[key].Add(context); return; } if (srcNode == dstNode) { if (context.sourceState != null && !this.HasState(this.activeStateMachine, context.sourceState, false)) { return; } if (context.sourceStateMachine != null && !this.HasStateMachine(this.activeStateMachine, context.sourceStateMachine, false)) { return; } } Slot fromSlot = srcNode.outputSlots.First <Slot>(); Slot toSlot = dstNode.inputSlots.First <Slot>(); this.Connect(fromSlot, toSlot); this.m_ConnectedSlotsCache.Add(key, new EdgeInfo(context)); }
public static void DrawTransitionElementCommon(Rect rect, TransitionEditionContext transitionContext, bool selected, bool focused) { rect.xMax -= 60f; if (transitionContext.transition == null) { GUI.Label(rect, new GUIContent("Not Found")); return; } bool flag = transitionContext.transition.solo; bool flag2 = transitionContext.transition.mute; GUI.Label(rect, new GUIContent(transitionContext.displayName, transitionContext.fullName)); rect.xMin = rect.xMax; rect.width = 30f; flag = GUI.Toggle(rect, flag, string.Empty); rect.xMin = rect.xMax; rect.width = 30f; flag2 = GUI.Toggle(rect, flag2, string.Empty); if (flag != transitionContext.transition.solo) { Undo.RegisterCompleteObjectUndo(transitionContext.transition, "Solo changed"); transitionContext.transition.solo = flag; } if (flag2 != transitionContext.transition.mute) { Undo.RegisterCompleteObjectUndo(transitionContext.transition, "Mute changed"); transitionContext.transition.mute = flag2; } }
public static void DrawTransitionElementCommon(Rect rect, TransitionEditionContext transitionContext, bool selected, bool focused) { rect.xMax -= 60f; if (transitionContext.transition == null) { GUI.Label(rect, new GUIContent("Not Found")); } else { bool solo = transitionContext.transition.solo; bool mute = transitionContext.transition.mute; GUI.Label(rect, new GUIContent(transitionContext.displayName, transitionContext.fullName)); rect.xMin = rect.xMax; rect.width = 30f; solo = GUI.Toggle(rect, solo, ""); rect.xMin = rect.xMax; rect.width = 30f; mute = GUI.Toggle(rect, mute, ""); if (solo != transitionContext.transition.solo) { Undo.RegisterCompleteObjectUndo(transitionContext.transition, "Solo changed"); transitionContext.transition.solo = solo; } if (mute != transitionContext.transition.mute) { Undo.RegisterCompleteObjectUndo(transitionContext.transition, "Mute changed"); transitionContext.transition.mute = mute; } } }
public void SetTransitionContext(TransitionEditionContext context) { this.m_TransitionContexts = new TransitionEditionContext[] { context }; this.m_SerializedTransition = null; this.SetTransitionToInspect(base.targets[0] as AnimatorTransitionBase); this.m_SyncTransitionContexts = false; }
public void Add(TransitionEditionContext context) { this.transitions.Add(context); }
public EdgeInfo(TransitionEditionContext context) { this.Add(context); }
private void CreateEdges(UnityEditor.Graphs.AnimationStateMachine.Node srcNode, UnityEditor.Graphs.AnimationStateMachine.Node dstNode, TransitionEditionContext context) { if ((srcNode != null) && (dstNode != null)) { string key = GenerateConnectionKey(srcNode, dstNode); if (this.m_ConnectedSlotsCache.ContainsKey(key)) { this.m_ConnectedSlotsCache[key].Add(context); } else if ((srcNode != dstNode) || (((context.sourceState == null) || this.HasState(this.activeStateMachine, context.sourceState, false)) && ((context.sourceStateMachine == null) || this.HasStateMachine(this.activeStateMachine, context.sourceStateMachine, false)))) { Slot fromSlot = srcNode.outputSlots.First <Slot>(); Slot toSlot = dstNode.inputSlots.First <Slot>(); this.Connect(fromSlot, toSlot); this.m_ConnectedSlotsCache.Add(key, new EdgeInfo(context)); } } }
public void Add(TransitionEditionContext context) { this.transitions.Add(context); }
public EdgeInfo(TransitionEditionContext context) { this.Add(context); }
public static void DrawTransitionElementCommon(Rect rect, TransitionEditionContext transitionContext, bool selected, bool focused) { rect.xMax -= 60f; if (transitionContext.transition == null) { GUI.Label(rect, new GUIContent("Not Found")); } else { bool solo = transitionContext.transition.solo; bool mute = transitionContext.transition.mute; GUI.Label(rect, new GUIContent(transitionContext.displayName, transitionContext.fullName)); rect.xMin = rect.xMax; rect.width = 30f; solo = GUI.Toggle(rect, solo, ""); rect.xMin = rect.xMax; rect.width = 30f; mute = GUI.Toggle(rect, mute, ""); if (solo != transitionContext.transition.solo) { Undo.RegisterCompleteObjectUndo(transitionContext.transition, "Solo changed"); transitionContext.transition.solo = solo; } if (mute != transitionContext.transition.mute) { Undo.RegisterCompleteObjectUndo(transitionContext.transition, "Mute changed"); transitionContext.transition.mute = mute; } } }