private Transform GetParentNode(CutSceneData.ATTACHMENT_TYPE attachmentType, string nodeName) { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown if (attachmentType == CutSceneData.ATTACHMENT_TYPE.NONE) { return(null); } Transform val = null; switch (attachmentType) { case CutSceneData.ATTACHMENT_TYPE.CAMERA: { CutSceneCamera activeCamera = GetActiveCamera(); val = activeCamera.transform; break; } case CutSceneData.ATTACHMENT_TYPE.MY_CHARACTER: case CutSceneData.ATTACHMENT_TYPE.PLAYER_1: case CutSceneData.ATTACHMENT_TYPE.PLAYER_2: case CutSceneData.ATTACHMENT_TYPE.PLAYER_3: val = GetPlayerNode(attachmentType); break; case CutSceneData.ATTACHMENT_TYPE.ENEMY: if (enemyInfo != null && enemyInfo.obj != null) { val = enemyInfo.obj.get_transform(); } break; case CutSceneData.ATTACHMENT_TYPE.ACTOR_1: val = GetActorTransform(0); break; case CutSceneData.ATTACHMENT_TYPE.ACTOR_2: val = GetActorTransform(1); break; case CutSceneData.ATTACHMENT_TYPE.ACTOR_3: val = GetActorTransform(2); break; case CutSceneData.ATTACHMENT_TYPE.ACTOR_4: val = GetActorTransform(3); break; } if (val != null) { if (string.IsNullOrEmpty(nodeName)) { return(val); } return(FindChildTransform(val, nodeName)); } return(null); }
private void UpdateCamera() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) AnimatorStateInfo currentAnimatorStateInfo = cameraAnimator.GetCurrentAnimatorStateInfo(0); if (currentAnimatorStateInfo.get_normalizedTime() >= 1f) { cutNo++; if (cameraAnimator.HasState(0, CUT_STATE_HASH[cutNo])) { cameraAnimator.Play(CUT_STATE_HASH[cutNo]); } else if (cameraAnimator.HasState(0, ENDING_STATE_ID)) { cameraAnimator.Play(ENDING_STATE_ID); EndCutScene(); } else { EndCutScene(); } } int num = cutNo % 2; for (int i = 0; i < cameras.Length; i++) { cameras[i].camera.get_gameObject().SetActive(num == i); } CutSceneCamera activeCamera = GetActiveCamera(); activeCamera.transform.set_position(cameraAnimatorTransform.get_position()); activeCamera.transform.set_rotation(cameraAnimatorTransform.get_rotation()); Camera camera = activeCamera.camera; Vector3 localScale = cameraAnimatorTransform.get_localScale(); camera.set_fieldOfView(localScale.x); }
private void DeleteGUI(int windowID) { GUILayout.BeginVertical(); GUILayout.Label("Delete " + currentMode + " '" + currentItem.FullDescription() + "'?"); GUILayout.BeginHorizontal(); if (GUILayout.Button("Yes")) { deleteCurrent = false; if (currentMode == Modes.Actor) { currentCutScene.actors.Remove(currentActor); currentActor = null; currentItem = null; } else if (currentMode == Modes.Camera) { currentCutScene.cameras.Remove(currentCamera); currentCamera = null; currentItem = null; } else { currentCutScene.actions.Remove(currentAction); currentAction = null; currentItem = null; } } if (GUILayout.Button("No")) { deleteCurrent = false; } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUI.DragWindow(); }
private void WindowGUI(int windowID) { // TODO - real loading if (currentCutScene == null) { currentCutScene = new CutSceneDefinition(); currentCutScene.Load("ContractConfigurator/CutScene/CameraTestCutScene.cfg"); } GUILayout.BeginHorizontal(); const int LIST_WIDTH = 500; GUILayout.BeginVertical(GUILayout.Width(LIST_WIDTH)); // The different modes GUILayout.BeginHorizontal(); if (GUILayout.Toggle(currentMode == Modes.Camera, "Cameras", toggleCenteredStyle)) { if (currentMode != Modes.Camera) { currentMode = Modes.Camera; scrollPosition = new Vector2(0, 0); currentItem = currentCamera; } } if (GUILayout.Toggle(currentMode == Modes.Actor, "Actors", toggleCenteredStyle)) { if (currentMode != Modes.Actor) { currentMode = Modes.Actor; scrollPosition = new Vector2(0, 0); currentItem = currentActor; } } if (GUILayout.Toggle(currentMode == Modes.Action, "Actions", toggleCenteredStyle)) { if (currentMode != Modes.Action) { currentMode = Modes.Action; scrollPosition = new Vector2(0, 0); currentItem = currentAction; } } GUILayout.EndHorizontal(); // Display the listing of entities scrollPosition = GUILayout.BeginScrollView(scrollPosition, false, true, GUILayout.Height(LIST_HEIGHT)); int currentIndex = -1; int i = 0; int listCount = 0; // Display the listing of cameras if (currentMode == Modes.Camera) { listCount = currentCutScene.cameras.Count; foreach (CutSceneCamera camera in currentCutScene.cameras) { if (currentCamera == camera) { currentIndex = i; } i++; GUILayout.BeginHorizontal(); if (GUILayout.Toggle(camera == currentCamera, camera.FullDescription(), toggleStyle, GUILayout.Width(LIST_WIDTH - 36))) { currentCamera = camera; currentItem = camera; } GUILayout.EndHorizontal(); } } // Display the listing of actors else if (currentMode == Modes.Actor) { listCount = currentCutScene.actors.Count; foreach (Actor actor in currentCutScene.actors) { if (currentActor == actor) { currentIndex = i; } i++; GUILayout.BeginHorizontal(); if (GUILayout.Toggle(actor == currentActor, actor.FullDescription(), toggleStyle, GUILayout.Width(LIST_WIDTH - 36))) { currentActor = actor; currentItem = actor; } GUILayout.EndHorizontal(); } } // Display the listing of cut scene actions else if (currentMode == Modes.Action) { listCount = currentCutScene.actions.Count; foreach (CutSceneAction action in currentCutScene.actions) { if (currentAction == action) { currentIndex = i; } i++; GUILayout.BeginHorizontal(); if (GUILayout.Toggle(action == currentAction, action.FullDescription(), toggleStyle, GUILayout.Width(LIST_WIDTH - 72))) { currentAction = action; currentItem = action; } GUILayout.BeginVertical(); GUILayout.Space(3); action.async = GUILayout.Toggle(action.async, new GUIContent("", "If checked, moves to the next action before waiting for this one to complete.")); GUILayout.EndVertical(); GUILayout.EndHorizontal(); } } GUILayout.EndScrollView(); GUILayout.BeginHorizontal(); GUILayout.Button("New"); if (GUILayout.Button("Up") && currentIndex > 0) { if (currentMode == Modes.Actor) { currentCutScene.actors[currentIndex] = currentCutScene.actors[currentIndex - 1]; currentCutScene.actors[currentIndex - 1] = currentActor; } else if (currentMode == Modes.Camera) { currentCutScene.cameras[currentIndex] = currentCutScene.cameras[currentIndex - 1]; currentCutScene.cameras[currentIndex - 1] = currentCamera; } else { currentCutScene.actions[currentIndex] = currentCutScene.actions[currentIndex - 1]; currentCutScene.actions[currentIndex - 1] = currentAction; } } if (GUILayout.Button("Down") && currentIndex != -1 && currentIndex != listCount - 1) { if (currentMode == Modes.Actor) { currentCutScene.actors[currentIndex] = currentCutScene.actors[currentIndex + 1]; currentCutScene.actors[currentIndex + 1] = currentActor; } else if (currentMode == Modes.Camera) { currentCutScene.cameras[currentIndex] = currentCutScene.cameras[currentIndex + 1]; currentCutScene.cameras[currentIndex + 1] = currentCamera; } else { currentCutScene.actions[currentIndex] = currentCutScene.actions[currentIndex + 1]; currentCutScene.actions[currentIndex + 1] = currentAction; } } if (GUILayout.Button("Delete") && currentIndex != -1) { deleteCurrent = true; } GUILayout.EndHorizontal(); GUILayout.EndVertical(); DrawDetailPane(); GUILayout.EndHorizontal(); GUI.DragWindow(); if (Event.current.type == EventType.Repaint && GUI.tooltip != toolTip) { toolTipTime = Time.fixedTime; toolTip = GUI.tooltip; } }
private IEnumerator InitImpl(string cutSceneDataPath, Action <bool> _onComplete) { LoadingQueue loadQueue = new LoadingQueue(this); if (!string.IsNullOrEmpty(cutSceneDataPath)) { LoadObject loadedCutSceneObj = loadQueue.Load(RESOURCE_CATEGORY.CUTSCENE, cutSceneDataPath, false); if (loadQueue.IsLoading()) { yield return((object)loadQueue.Wait()); } cutSceneData = (loadedCutSceneObj.loadedObject as CutSceneData); } if (cutSceneData == null) { _onComplete?.Invoke(false); } else { for (int n = 0; n < cutSceneData.seDataList.Count; n++) { loadQueue.CacheSE(cutSceneData.seDataList[n].seId, null); } for (int m = 0; m < cutSceneData.effectKeyData.Count; m++) { loadQueue.CacheEffect(RESOURCE_CATEGORY.EFFECT_ACTION, cutSceneData.effectKeyData[m].effectId); } for (int k = 0; k < 2; k++) { if (cameras[k] == null) { CutSceneCamera cutSceneCamera = new CutSceneCamera(); GameObject cameraObj = new GameObject("cut_scene_camera_ " + k.ToString()); cutSceneCamera.camera = cameraObj.AddComponent <Camera>(); cutSceneCamera.transform = cameraObj.get_transform(); cutSceneCamera.transform.set_parent(_transform); cameraObj.SetActive(false); cameras[k] = cutSceneCamera; } } playerInfo = new PlayerInfo[4]; enemyInfo = new EnemyInfo(); actorInfo = new ActorInfo[cutSceneData.actorData.Length]; effectInfo = new EffectInfo[cutSceneData.effectKeyData.Count]; seInfo = new SeInfo[cutSceneData.seDataList.Count]; for (int l = 0; l < cutSceneData.actorData.Length; l++) { CutSceneData.ActorData actorData = cutSceneData.actorData[l]; actorInfo[l] = new ActorInfo(); actorInfo[l].keyData = actorData; actorInfo[l].obj = Object.Instantiate <GameObject>(actorData.prefab); actorInfo[l].obj.get_transform().set_parent(_transform); actorInfo[l].animator = actorInfo[l].obj.GetComponent <Animator>(); actorInfo[l].animator.set_cullingMode(0); actorInfo[l].animator.set_runtimeAnimatorController(actorData.animatorController); actorInfo[l].animator.Rebind(); actorInfo[l].obj.SetActive(false); } for (int j = 0; j < cutSceneData.effectKeyData.Count; j++) { EffectInfo effect = new EffectInfo { keyData = cutSceneData.effectKeyData[j] }; effectInfo[j] = effect; } for (int i = 0; i < cutSceneData.seDataList.Count; i++) { SeInfo se = new SeInfo { keyData = cutSceneData.seDataList[i] }; seInfo[i] = se; } if (loadQueue.IsLoading()) { yield return((object)loadQueue.Wait()); } _onComplete?.Invoke(true); } }