This shows you the differences between two versions of the page.
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:// | **Mecanim Control** is a coding tool made that allow for a wider variety of common methods used by the [[http:// | ||
- | [[http:// | ||
---- | ---- | ||
Line 54: | Line 53: | ||
* [[# | * [[# | ||
* [[# | * [[# | ||
+ | * [[# | ||
* [[# | * [[# | ||
* [[# | * [[# | ||
Line 62: | Line 62: | ||
**Default Animation**\\ | **Default Animation**\\ | ||
AnimationData // | AnimationData // | ||
- | 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 [[# |
<code c#> | <code c#> | ||
Line 75: | Line 75: | ||
**Animations**\\ | **Animations**\\ | ||
AnimationData[] // | AnimationData[] // | ||
- | The array containing | + | |
+ | **Properties**\\ | ||
+ | AnimationClip clip - The AnimationClip file.\\ | ||
+ | string clipName - Animation name.\\ | ||
+ | float speed - Animation speed.\\ | ||
+ | float transitionDuration - Blending Duration.\\ | ||
+ | WrapMode wrapMode - The animation' | ||
+ | bool applyRootMotion - If this and //Override Root Motion// is toggled this animation will toggle the Animator' | ||
+ | |||
+ | **Description**\\ | ||
+ | This array contain | ||
<code c#> | <code c#> | ||
Line 110: | Line 120: | ||
mecanimControl = gameObject.GetComponent< | mecanimControl = gameObject.GetComponent< | ||
mecanimControl.alwaysPlay = true; | mecanimControl.alwaysPlay = true; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | {{anchor: | ||
+ | **Override Root Motion**\\ | ||
+ | bool // | ||
+ | If both applyRootMotion (under the animation element) and this variable is //true//, this animation will toggle the Animator' | ||
+ | |||
+ | |||
+ | <code c#> | ||
+ | void Start () { | ||
+ | mecanimControl = gameObject.GetComponent< | ||
+ | mecanimControl.overrideRootMotion = true; | ||
+ | mecanimControl.animationData[0].applyRootMotion = true; | ||
} | } | ||
</ | </ |