User Tools

Site Tools


mecanimcontrol

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
mecanimcontrol [2015/03/15 00:05]
Mistermind
mecanimcontrol [2018/09/17 10:29] (current)
Mistermind [Public Variables]
Line 6: Line 6:
 **Mecanim Control** is a coding tool made that allow for a wider variety of common methods used by the [[http://docs.unity3d.com/Documentation/ScriptReference/Animation.html|Animation component]] with Mecanim (Humanoid/Generic) animations. It allows you to not only dynamically load any animation clip during runtime, but also tap into several methods currently missing in this magnificent system. **Mecanim Control** is a coding tool made that allow for a wider variety of common methods used by the [[http://docs.unity3d.com/Documentation/ScriptReference/Animation.html|Animation component]] with Mecanim (Humanoid/Generic) animations. It allows you to not only dynamically load any animation clip during runtime, but also tap into several methods currently missing in this magnificent system.
  
-[[http://forum.unity3d.com/threads/224315-Mecanim-Control|Mecanim Control]] is a sub-tool of [[http://forum.unity3d.com/threads/218123-RELEASED-Universal-Fighting-Engine-(UFE)|Universal Fighting Engine]]. It's source code is available entirely free in the **Source** version of UFE. 
  
 ---- ----
Line 54: Line 53:
   * [[#debugmode|Debug Mode]]   * [[#debugmode|Debug Mode]]
   * [[#alwaysplay|Always Play]]   * [[#alwaysplay|Always Play]]
 +  * [[#overriderootmotion|Override Root Motion]]
   * [[#defaulttransitionduration|Default Transition Duration]]   * [[#defaulttransitionduration|Default Transition Duration]]
   * [[#defaultwrapmode|Default Wrap Mode]]   * [[#defaultwrapmode|Default Wrap Mode]]
Line 62: Line 62:
 **Default Animation**\\ **Default Animation**\\
 AnimationData //defaultAnimation//;\\ AnimationData //defaultAnimation//;\\
-By default, if no order is given, the animator will play the animation stored in this AnimationData.+By default, if no order is given, the animator will play the animation stored in this AnimationData. If you don't assign an animation, Mecanim Control will instantiate the first animation listed on [[#animations|animations]].
  
 <code c#> <code c#>
Line 75: Line 75:
 **Animations**\\ **Animations**\\
 AnimationData[] //animations//;\\ AnimationData[] //animations//;\\
-The array containing all the AnimationData stored by either the UI or by using AddClip.+ 
 +**Properties**\\ 
 +AnimationClip clip - The AnimationClip file.\\ 
 +string clipName - Animation name.\\ 
 +float speed - Animation speed.\\ 
 +float transitionDuration - Blending Duration.\\ 
 +WrapMode wrapMode - The animation's default [[http://docs.unity3d.com/ScriptReference/WrapMode.html|WrapMode]].\\ 
 +bool applyRootMotion - If this and //Override Root Motion// is toggled this animation will toggle the Animator's [[http://docs.unity3d.com/Manual/RootMotion.html|Root Motion]] 
 + 
 +**Description**\\ 
 +This array contain all the AnimationData stored by either the UI or by using AddClip. Its then used to emulate a state machine under the //Animator Controller//.
  
 <code c#> <code c#>
Line 110: Line 120:
  mecanimControl = gameObject.GetComponent<MecanimControl>();  mecanimControl = gameObject.GetComponent<MecanimControl>();
  mecanimControl.alwaysPlay = true;  mecanimControl.alwaysPlay = true;
 +}
 +</code>
 +
 +----
 +{{anchor:overriderootmotion}}
 +**Override Root Motion**\\
 +bool //overrideRootMotion//;\\
 +If both applyRootMotion (under the animation element) and this variable is //true//, this animation will toggle the Animator's [[http://docs.unity3d.com/Manual/RootMotion.html|Root Motion]].
 +
 +
 +<code c#>
 +void Start () {
 + mecanimControl = gameObject.GetComponent<MecanimControl>();
 + mecanimControl.overrideRootMotion = true;
 + mecanimControl.animationData[0].applyRootMotion = true;
 } }
 </code> </code>
mecanimcontrol.1426392344.txt.gz · Last modified: 2015/03/15 00:05 by Mistermind