Exemple #1
0
 private void AnimatorEnteredState(MecanimStateEnteredReporter stateReporter, SerializableStateReference state, StateTransitionTag tag)
 {
     if (_eventTrigger != StartingStateOrStateEntry.OnlyStartingState)
     {
         EnteredState(stateReporter, state, tag);
     }
 }
 public SerializableStateReference(SerializableStateReference original)
 {
     if (original != null)
     {
         _name = original._name;
         _guid = original._guid;
     }
 }
 void Reporter_EnteredState(MecanimStateEnteredReporter stateReporter, SerializableStateReference state, StateTransitionTag tag)
 {
     LastStateEntered = state;
     if (AnimatorEnteredState != null)
     {
         AnimatorEnteredState(stateReporter, state, tag);
     }
 }
Exemple #4
0
 public SerializableStateReference ToSerializableReference()
 {
     if (_serializableReference == null)
     {
         _serializableReference = new SerializableStateReference(_stateName, _guidString);
     }
     return(_serializableReference);
 }
Exemple #5
0
 public StateBinding(StateBinding original)
 {
     if (original != null)
     {
         _stateEntered = new SerializableStateReference(original._stateEntered);
         _parameter    = new SerializableAnimatorControllerParameter(original._parameter);
         _isDelayed    = original._isDelayed;
         _delayTime    = original._delayTime;
     }
 }
Exemple #6
0
 private void EnteredState(MecanimStateEnteredReporter stateReporter, SerializableStateReference state, StateTransitionTag tag)
 {
     if (state.Name == _stateName)
     {
         _eventCR = StartCoroutine(InvokeEvent());
     }
     else if (_eventCR != null)
     {
         StopCoroutine(_eventCR);
         _eventCR = null;
     }
 }
Exemple #7
0
 /// <summary>
 /// Get an index that represents the state in the broadcaster state arrays. Comparison is made by Guid.
 /// </summary>
 /// <param name="state">
 /// The state to look for.
 /// </param>
 private int GetStateIndex(SerializableStateReference state)
 {
     if (state != null)
     {
         for (int i = 1; i < _broadcasterStates.Length; i++)
         {
             if (_broadcasterStates[i].Guid == state.Guid)
             {
                 return(i);
             }
         }
     }
     // Couldn't find the state, default to "Unassigned"
     return(0);
 }
 private void EnteredState(MecanimStateEnteredReporter stateReporter, SerializableStateReference state, StateTransitionTag tag)
 {
     StopDelayedParameterChanges();
     foreach (var binding in _stateBindings)
     {
         if (binding.StateEntered.Guid == state.Guid)
         {
             if (!binding.IsDelayed)
             {
                 Receiver.SetParameter(binding.Parameter);
             }
             else if (gameObject.activeInHierarchy)
             {
                 _delayedParameterSets.Add(StartCoroutine(SetParameterAfterDelay(binding.DelayTime, binding.Parameter)));
             }
         }
     }
 }
 void Broadcaster_AnimatorStateEntered(MecanimStateEnteredReporter stateReporter, SerializableStateReference state, StateTransitionTag tag)
 {
     EnteredState(stateReporter, state, tag);
 }