public IEnumerator Lerp(BatchNode tran, Vector3 newPosition, bool inScreen, bool destroy = false, float speed = 1, float delay = 0) { Debug.Log("Lerp"); yield return(new WaitForSecondsRealtime(delay)); yield return(StartCoroutine(tran.Transfer(newPosition, inScreen, false, 0, speed))); if (destroy) { DestroyTran(tran); } }
public IEnumerator Lerp(BatchNode tran, Vector3 newPosition, bool inScreen, bool destroy = false, float speed = 1, float delay = 0) { Debug.Log("Lerp"); yield return(new WaitForSecondsRealtime(delay)); yield return(StartCoroutine(tran.Transfer(newPosition, inScreen))); if (destroy) { Scene theScene = tran.transform.parent.gameObject.GetComponent <Scene>(); if (theScene == null) { Debug.LogError("TransitionForm.cs Average: parent doesn't have Scene component"); } else { theScene.RemoveSceneBatch(tran.name); theScene.DestroyOnEmpty(); } } }