using UnityEngine; using System.Collections; using System.Linq; using System; [DisallowMultipleComponent] public class ResumeAnimator : MonoBehaviour { [System.Serializable] struct LayerInfo { public int nameHash; public float time; } private Animator anim; private LayerInfo[] layerInfo = null; private object[] parameters ; [SerializeField] AnimatorParameter parameter = default; void Awake () { anim = GetComponent (); layerInfo = new LayerInfo[anim.layerCount]; for (int i=0; i()) { resumeAnim.Save (); } } #if UNITY_EDITOR public static void AddResumeAnimatorInChildren (GameObject obj) { var components = obj.GetComponentsInChildren (); foreach (var item in components) { ResumeAnimator resumeAnim = item.GetComponent (); if (resumeAnim == null) resumeAnim = item.gameObject.AddComponent (); } } #endif }