Exemplo n.º 1
0
 private void BuildNames()
 {
     if (this.sourceState)
     {
         this.m_DisplayName = this.transition.GetDisplayName(this.sourceState);
     }
     else if (this.sourceStateMachine)
     {
         this.m_DisplayName = this.transition.GetDisplayName(this.sourceStateMachine);
     }
     else if (this.transition)
     {
         this.m_DisplayName = this.transition.GetDisplayName(null);
     }
     else
     {
         this.m_DisplayName = "To Default State";
     }
     this.m_FullName = string.Empty;
     if (AnimatorControllerTool.tool && AnimatorControllerTool.tool.stateMachineGraph && AnimatorControllerTool.tool.stateMachineGraph.rootStateMachine && this.transition != null)
     {
         string source            = (!this.isAnyStateTransition) ? string.Empty : "AnyState";
         string text              = string.Empty;
         Graph  stateMachineGraph = AnimatorControllerTool.tool.stateMachineGraph;
         if (this.sourceState)
         {
             source = stateMachineGraph.GetStatePath(this.sourceState);
         }
         else if (this.sourceStateMachine)
         {
             source = stateMachineGraph.GetStateMachinePath(this.sourceStateMachine);
         }
         if (this.transition.destinationState)
         {
             text += stateMachineGraph.GetStatePath(this.transition.destinationState);
         }
         else if (this.transition.destinationStateMachine)
         {
             text += stateMachineGraph.GetStateMachinePath(this.transition.destinationStateMachine);
         }
         this.m_FullName = AnimatorTransitionBase.BuildTransitionName(source, text);
     }
 }
Exemplo n.º 2
0
 private void BuildNames()
 {
     if (this.sourceState != null)
     {
         this.m_DisplayName = this.transition.GetDisplayName(this.sourceState);
     }
     else if (this.sourceStateMachine != null)
     {
         this.m_DisplayName = this.transition.GetDisplayName(this.sourceStateMachine);
     }
     else if (this.transition != null)
     {
         this.m_DisplayName = this.transition.GetDisplayName(null);
     }
     else
     {
         this.m_DisplayName = "To Default State";
     }
     this.m_FullName = "";
     if (((AnimatorControllerTool.tool != null) && (AnimatorControllerTool.tool.stateMachineGraph != null)) && ((AnimatorControllerTool.tool.stateMachineGraph.rootStateMachine != null) && (this.transition != null)))
     {
         string source      = !this.isAnyStateTransition ? "" : "AnyState";
         string destination = "";
         UnityEditor.Graphs.AnimationStateMachine.Graph stateMachineGraph = AnimatorControllerTool.tool.stateMachineGraph;
         if (this.sourceState != null)
         {
             source = stateMachineGraph.GetStatePath(this.sourceState);
         }
         else if (this.sourceStateMachine != null)
         {
             source = stateMachineGraph.GetStateMachinePath(this.sourceStateMachine);
         }
         if (this.transition.destinationState != null)
         {
             destination = destination + stateMachineGraph.GetStatePath(this.transition.destinationState);
         }
         else if (this.transition.destinationStateMachine != null)
         {
             destination = destination + stateMachineGraph.GetStateMachinePath(this.transition.destinationStateMachine);
         }
         this.m_FullName = AnimatorTransitionBase.BuildTransitionName(source, destination);
     }
 }