protected void AddMovementScript() { if (Config.movementScriptPath != String.Empty) { if (_cameraMovement) { _cameraMovement.Shutdown(); } if (Config.movementScriptPath == "SongMovementScript") { _cameraMovement = _cam.gameObject.AddComponent <SongCameraMovement>(); } else if (File.Exists(Config.movementScriptPath)) { _cameraMovement = _cam.gameObject.AddComponent <CameraMovement>(); } else { return; } if (_cameraMovement.Init(this)) { ThirdPersonPos = Config.Position; ThirdPersonRot = Config.Rotation; Config.thirdPerson = true; ThirdPerson = true; CreateScreenRenderTexture(); } } }
protected void AddMovementScript() { if (Config.movementScriptPath != String.Empty) { if (_cameraMovement) { _cameraMovement.Shutdown(); } if (Config.movementScriptPath == "SongMovementScript") { _cameraMovement = _cam.gameObject.AddComponent <SongCameraMovement>(); } else if (File.Exists(Config.movementScriptPath) || File.Exists(Path.Combine(UnityGame.UserDataPath, Plugin.Name, "Scripts", Config.movementScriptPath)) || File.Exists(Path.Combine(UnityGame.UserDataPath, Plugin.Name, "Scripts", Path.GetFileName(Config.movementScriptPath)))) { _cameraMovement = _cam.gameObject.AddComponent <CameraMovement>(); } else { return; } if (_cameraMovement.Init(this)) { ThirdPersonPos = Config.Position; ThirdPersonRot = Config.Rotation; Config.thirdPerson = true; ThirdPerson = true; CreateScreenRenderTexture(); } } }
public string AddMovementScript() { string songScriptPath = Config.movementScriptPath; if (Config.movementScriptPath != String.Empty || Config.songSpecificScript) { if (_cameraMovement) { _cameraMovement.Shutdown(); } if (CustomPreviewBeatmapLevelPatch.customLevelPath != String.Empty) { songScriptPath = Path.Combine(CustomPreviewBeatmapLevelPatch.customLevelPath, "SongScript.json"); } else { songScriptPath = "SongScript"; } if (Config.songSpecificScript && File.Exists(songScriptPath)) { _cameraMovement = _cam.gameObject.AddComponent <CameraMovement>(); } else if (File.Exists(Config.movementScriptPath) || File.Exists(Path.Combine(UnityGame.UserDataPath, Plugin.Name, "Scripts", Config.movementScriptPath)) || File.Exists(Path.Combine(UnityGame.UserDataPath, Plugin.Name, "Scripts", Path.GetFileName(Config.movementScriptPath)))) { _cameraMovement = _cam.gameObject.AddComponent <CameraMovement>(); } else { return("Not Find Script"); } if (_cameraMovement.Init(this, Config.songSpecificScript)) { ThirdPersonPos = Config.Position; ThirdPersonRot = Config.Rotation; Config.thirdPerson = true; ThirdPerson = true; CreateScreenRenderTexture(); } else { return("Fail CameraMovement Initialize"); } return(songScriptPath); } return(string.Empty); }