Created
February 2, 2021 16:04
-
-
Save XakazukinX/63c07abb7ecfa74ca30bc3cfd42c9368 to your computer and use it in GitHub Desktop.
AnimationClipSettingのプロパティを確認したいときに使ったやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
public static class CheckAnimationClipSettingProperty | |
{ | |
[MenuItem("Assets/Check Animation Clip Setting Property")] | |
static void SetAnimationOptions() | |
{ | |
var selectClips = Selection.GetFiltered(typeof(AnimationClip), SelectionMode.Assets); | |
if (selectClips.Length == 0) | |
{ | |
return; | |
} | |
var checkClip = selectClips[0] as AnimationClip; | |
if (checkClip == null) | |
{ | |
return; | |
} | |
var clipSetting = AnimationUtility.GetAnimationClipSettings(checkClip); | |
{ | |
{ | |
//looptime | |
Debug.Log(nameof(clipSetting.loopTime) + "__" + clipSetting.loopTime); | |
//looptime/looppose | |
Debug.Log(nameof(clipSetting.loopBlend) + "__" + clipSetting.loopBlend); | |
//looptime/cycleoffset | |
Debug.Log(nameof(clipSetting.cycleOffset) + "__" + clipSetting.cycleOffset); | |
} | |
{ | |
//RootTransformRotation/BakeIntoPose | |
Debug.Log(nameof(clipSetting.loopBlendOrientation) + "__" + clipSetting.loopBlendOrientation); | |
//RootTransformRotation/BasedUpon(True=Original,False=Original) | |
Debug.Log(nameof(clipSetting.keepOriginalOrientation) + "__" + clipSetting.keepOriginalOrientation); | |
//RootTransformRotation/Offset | |
Debug.Log(nameof(clipSetting.orientationOffsetY) + "__" + clipSetting.orientationOffsetY); | |
} | |
{ | |
//RootTransformPosition(Y)/BakeIntoPose | |
Debug.Log(nameof(clipSetting.loopBlendPositionY) + "__" + clipSetting.loopBlendPositionY); | |
//heightFromFeetがTrueのときはBasedUponがFeetになる | |
{ | |
//RootTransformPosition(Y)/BasedUpon(at Start)(True=Original,False=Center of Mass) | |
Debug.Log(nameof(clipSetting.keepOriginalPositionY) + "__" + clipSetting.keepOriginalPositionY); | |
//RootTransformPosition(Y)/BasedUpon(at Start)(True=Feet) | |
Debug.Log(nameof(clipSetting.heightFromFeet) + "__" + clipSetting.heightFromFeet); | |
} | |
//RootTransformPosition(Y)/Offset | |
Debug.Log(nameof(clipSetting.level) + "__" + clipSetting.level); | |
} | |
{ | |
//RootTransformRotation(XZ)/BakeIntoPose | |
Debug.Log(nameof(clipSetting.loopBlendPositionXZ) + "__" + clipSetting.loopBlendPositionXZ); | |
//RootTransformRotation(XZ)/BasedUpon(at Start)(True=Original,False=Center of Mass) | |
Debug.Log(nameof(clipSetting.keepOriginalPositionXZ) + "__" + clipSetting.keepOriginalPositionXZ); | |
} | |
{ | |
//mirror | |
Debug.Log(nameof(clipSetting.mirror) + "__" + clipSetting.mirror); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment