EditorPrefs.SetFloat("PlayFromHere.forward.y", forward.y);
EditorPrefs.SetFloat("PlayFromHere.forward.z", forward.z);
EditorUtility.DisplayProgressBar("Play From Here", "Entering Play From here mode...", 1.0f);
EditorApplication.isPlaying = true;
}
if (state == PlayModeStateChange.EnteredPlayMode && (PlayerPrefs.GetInt("PlayFromHere") == 1))
{
EditorUtility.ClearProgressBar();
if (OnPlayFromHere != null)
Vector3 position = new Vector3(
private void Awake()
Callable.Call(onAwake);
Callable.Call(onAwake, gameObject);
private void OnDestroy()
Callable.Call(onDestroy);
Callable.Call(onDestroy, gameObject);
private void OnEnable()
Callable.Call(OnEnableEvent);
Callable.Call(OnEnableEvent, gameObject);
Callable.Call(OnDisableEvent);
Callable.Call(OnDisableEvent, gameObject);
void Update()
if (Input.GetKeyDown(Key))
Callable.Call(OnKeyDownEvent);
Callable.Call(OnKeyDownEvent, gameObject);
Callable.Call(OnKeyUpEvent);
Callable.Call(OnKeyUpEvent, gameObject);
void Execute()
Callable.Call(OnMessageRecieved);
Callable.Call(OnMessageRecieved, gameObject);
private void Start()
Callable.Call(OnStart);
Callable.Call(OnStart, gameObject);
public override void Execute(GameObject instigator = null)
if (GetCondition())
Callable.Call(OnConditionValid);
Callable.Call(OnConditionValid, instigator);
Callable.Call(OnConditionInvalid);
Callable.Call(OnConditionInvalid, instigator);
public abstract bool GetCondition();
IEnumerator m_Coroutine;
public void Cancel()
public void Cancel(GameObject instigator = null)
Callable.Call(OnCanceled);
Callable.Call(OnCanceled, instigator);
m_Coroutine = null;
if (m_Coroutine != null) Cancel();
m_Coroutine = RunDelay(Delay);
m_Coroutine = RunDelay(Delay, instigator);
IEnumerator RunDelay(float Seconds)
IEnumerator RunDelay(float Seconds, GameObject instigator = null)
Callable.Call(OnDelayComplete);
Callable.Call(OnDelayComplete, instigator);
public enum Mode
PlayerAndEditor,
EditorOnly,
PlayerOnly
public Mode ExecutionPath;
public Mode ExecutionPath = Mode.PlayerAndEditor;
[ReorderableList]
public Callable[] OnExecute;
bool acceptPlayFromHere = !(DisableOnPlayFromHere && (PlayerPrefs.GetInt("PlayFromHere") == 1));
case Mode.PlayerAndEditor:
if (acceptPlayFromHere)
Callable.Call(OnExecute, instigator);
break;
if (Application.isEditor && !(DisableOnPlayFromHere && (PlayerPrefs.GetInt("PlayFromHere") == 1)))
Callable.Call(OnExecute);
if (Application.isEditor && acceptPlayFromHere)
if (!Application.isEditor) Callable.Call(OnExecute);
if (!Application.isEditor && acceptPlayFromHere)
m_Coroutine = RunDelay();
m_Coroutine = RunDelay(instigator);
IEnumerator RunDelay()
IEnumerator RunDelay(GameObject instigator = null)
Callable.Call(OnComplete);
Callable.Call(OnComplete, instigator);