private void SpawnCameraForTransition(CutSceneTransition c, int index, CameraCutSceneTrigger trigger) { GameObject g = new GameObject("TEMPCAM#" + index); g.AddComponent <Camera>(); if (c.Type == CutSceneTransition.State.FollowTransform) { g.transform.parent = c.FollowTarget; } g.transform.localPosition = c.Pos; g.transform.eulerAngles = c.Rot; trigger.editorTempObjects.Add(g); }
private void SaveInfoToTransition(CameraCutSceneTrigger trigger, int index) { CutSceneTransition current = trigger.cutScene[index]; GameObject g = trigger.editorTempObjects[index]; if (g.transform.parent == null) { current.Type = CutSceneTransition.State.Static; current.FollowTarget = null; } else { current.Type = CutSceneTransition.State.FollowTransform; current.FollowTarget = g.transform.parent; } current.Rot = g.transform.eulerAngles; current.Pos = g.transform.localPosition; }
public static float[] PlayTransition(CutSceneTransition cst, Func <float> OnHalfway = null) { string startName, endName; switch (cst) { case CutSceneTransition.Fade: startName = "FadeOut"; endName = "FadeIn"; break; default: startName = endName = ""; break; } instance.StartCoroutine(instance.PlayTransitionOverTime(startName, endName, OnHalfway)); return(new float[] { instance.anim.GetClip(startName).length, instance.anim.GetClip(endName).length }); }