/// <summary> /// Use this function to show a new editor window for creating a new AnimObject asset. /// </summary> /// <param name="animController">The AnimationController that this AnimObject will be added to</param> /// <param name="animation">Which "Animation" we're adding this AnimObject to</param> public static void ShowAddNewAnimObjectWindow(RSRAnimationController animController, AnimObject.AnimationEnum animation) { window = EditorWindow.GetWindow <AddNewAnimObject>(false, "Add New AnimObject"); window.SetTargetAnimController(animController); /* Now we need to find which Animation we're dealing with */ window._targetAOH = window._targetAnimController.GetAnimObjectHolders().First(aoh => aoh.GetAnimationEnum() == animation); }
void OnEnable() { if (_animController == null) { RSRUtility.SetupMember <RSRAnimationController>(_animController, gameObject); _animController = gameObject.GetComponent <RSRAnimationController>(); } }
public void OnEnable() { /* Get ref to animController */ _animController = (RSRAnimationController)target; if (_animController.GetAnimObjectHolders() == null) { _animController.SetAnimObjectHolders(new AnimObjectHolder[] {}); } SetupStyles(); }
/* * targetObj: in this case, the object that will be doing an animation * animEnum: Animation for targetObj to play */ public virtual IEnumerator PlayTarget(RSRMonoBehaviour targetObj, AnimObject.AnimationEnum animEnum) { RSRAnimationController targetAnimController = targetObj.GetComponent <RSRAnimationController>(); if (targetAnimController == null) { Debug.LogWarning("targetObj " + targetObj.ToString() + "does not have an AnimationController attached!"); yield break; } yield return(new WaitForSeconds(delayForTargetAnim)); //DELAY if (optionalTargetAnimationOverride == AnimationEnum.Default) { targetObj.PlayAnimation(animEnum); } else { targetObj.PlayAnimation(optionalTargetAnimationOverride); } }
public void SetTargetAnimController(RSRAnimationController target) { _targetAnimController = target; }
bool willOverride = false; //Will adding this anim override an existing anim? public static void ShowAddNewAnimationWindow(RSRAnimationController animController) { window = EditorWindow.GetWindow <AddNewAnimation>(false, "Add New AnimObject"); window.SetTargetAnimController(animController); }