//------------------------FUNCTION------------------------------------ /// <summary> /// At one time, there should not be more than one transition performed on the same scene. (No interruption protection) /// </summary> /// <param name="name"></param> /// <param name="block"></param> /// <param name="destroy"></param> public void PerformTransition(string name, TransitionParameterBlock block, bool destroy) // this function should only be called by SceneManager, cause void scene should never be destroyed { /*BatchNode tmpNode; * * tmpNode = SceneManager.instance.GetBackground(name); * tmpNode.AfterArrival.AddListener(tmpNode.DestroyHandler); * * tmpNode = SceneManager.instance.GetMidground(name); * tmpNode.AfterArrival.AddListener(tmpNode.DestroyHandler); * * tmpNode = SceneManager.instance.GetForeground(name); * tmpNode.AfterArrival.AddListener(tmpNode.DestroyHandler); * * tmpNode = SceneManager.instance.GetOthers(name); * tmpNode.AfterArrival.AddListener(tmpNode.DestroyHandler);*/ StartCoroutine(Movements[block.BackgroundMethod](SceneManager.instance.GetBackground(name), block.BackgroundPosition, block.BackgroundInScreen, destroy, block.BackgroundSpeed, block.BackgroundDelay)); StartCoroutine(Movements[block.MidgroundMethod](SceneManager.instance.GetMidground(name), block.MidgroundPosition, block.MidgroundInScreen, destroy, block.MidgroundSpeed, block.MidgroundDelay)); StartCoroutine(Movements[block.ForegroundMethod](SceneManager.instance.GetForeground(name), block.ForegroundPosition, block.ForegroundInScreen, destroy, block.ForegroundSpeed, block.ForegroundDelay)); StartCoroutine(Movements[block.OthersMethod](SceneManager.instance.GetOthers(name), block.OthersPosition, block.OthersInScreen, destroy, block.OthersSpeed, block.OthersDelay)); // not finished. Still need to deal with cameras }
public void ClearParameter(ref TransitionParameterBlock block) { block.BackgroundMethod = 0; block.MidgroundMethod = 0; block.ForegroundMethod = 0; block.BackgroundCameraMethod = 0; block.MainCameraMethod = 0; block.OthersMethod = 0; block.BackgroundPosition = Vector3.zero; block.MidgroundPosition = Vector3.zero; block.ForegroundPosition = Vector3.zero; block.BackgroundCameraPosition = Vector3.zero; block.MainCameraPosition = Vector3.zero; block.OthersPosition = Vector3.zero; block.BackgroundInScreen = false; block.MidgroundInScreen = false; block.ForegroundInScreen = false; block.OthersInScreen = false; block.BackgroundSpeed = 1; block.MidgroundSpeed = 1; block.ForegroundSpeed = 1; block.BackgroundCameraSpeed = 1; block.MainCameraSpeed = 1; block.OthersSpeed = 1; block.BackgroundCameraDelay = 0; block.BackgroundDelay = 0; block.ForegroundDelay = 0; block.MainCameraDelay = 0; block.MidgroundDelay = 0; block.OthersDelay = 0; }
public void SetMainCameraParameters(ref TransitionParameterBlock block, int method, Vector3 newPosition, bool inScreen, float speed = 1, float delay = 0) { block.MainCameraMethod = method; block.MainCameraPosition = newPosition; block.MainCameraSpeed = speed; block.MainCameraDelay = delay; }
public void SetMidgroundParameters(ref TransitionParameterBlock block, int method, Vector3 newPosition, bool inScreen, float speed = 1, float delay = 0) { block.MidgroundMethod = method; block.MidgroundPosition = newPosition; block.MidgroundInScreen = inScreen; block.MidgroundSpeed = speed; block.MidgroundDelay = delay; }