|
using System;
|
using System.Collections;
|
using UnityEngine;
|
using UnityEngine.Events;
|
|
|
|
public abstract class Motion : MonoBehaviour
|
{
|
|
private int m_index = -1;
|
public int index
|
{
|
get { return m_index; }
|
set { m_index = value; }
|
}
|
public SelectObject selectObject;
|
|
static public string animParameter = "mode";
|
[SerializeField]
|
private Motion prevMotion;
|
|
|
public Transform MotionTransform { get { return transform; } }
|
|
|
|
private void Start()
|
{
|
//ModelTypeManager.Inst.OnChangeModel.AddListener((value) => OnChangeModel());
|
}
|
|
|
public Motion GetCurrentMotion()
|
{
|
return prevMotion;
|
}
|
public abstract IEnumerator Play();
|
public abstract IEnumerator ReversePlay();
|
public virtual IEnumerator PlayAndNext()
|
{
|
yield return StartCoroutine(Play());
|
|
}
|
|
public virtual IEnumerator PlayAndNext(Action<bool> callBack)
|
{
|
|
callBack(false);
|
yield return StartCoroutine(Play());
|
|
|
callBack(true);
|
}
|
|
|
|
public virtual IEnumerator PrevReverse()
|
{
|
|
yield return StartCoroutine(prevMotion.PrevReverse());
|
|
|
}
|
|
|
public virtual IEnumerator PrevReverse(Action<bool> callBack)
|
{
|
callBack(false);
|
|
|
yield return StartCoroutine(prevMotion.PrevReverse(callBack));
|
yield break;
|
|
}
|
|
public virtual void Initialize()
|
{
|
|
}
|
|
|
|
private void Awake()
|
{
|
Initialize();
|
}
|
|
|
|
}
|