static void OnPostprocessAllAssets(
            string[] importedAssets,
            string[] deletedAssets,
            string[] movedAssets,
            string[] movedFromAssetPaths)
        {
            bool animChanged = false;

            foreach (string str in importedAssets)
            {
                string[] splitStr = str.Split('.');

                if (splitStr.Length < 2)
                {
                    return;
                }

                string extension = splitStr[splitStr.Length - 1];
                if (extension == "anim")
                {
                    animChanged = true;
                    break;
                }
            }

            if (animChanged)
            {
                DashAnimation.RecacheAnimationAssets();
            }
        }
Exemple #2
0
        public override void OnInspectorGUI()
        {
            DashAnimation animation = (DashAnimation)target;

            AnimationClip clip = (AnimationClip)EditorGUILayout.ObjectField(animation.clip, typeof(AnimationClip), false);

            animation.ExtractClip(clip);

            if (animation.clip != null)
            {
                GUILayout.Label("Animation Curves: " + animation.AnimationCurves.Count);
                GUILayout.Label("Duration: " + animation.Duration);
            }
        }