public void ReleaseOverride(string id) { if (!camTypeDict.Contains(id)) { Debug.Log("No such key-id found, skipping Release camera... id: " + id); return; } CameraModderParamsBase x = camTypeDict.LastValue; camTypeDict.Release(id); TransitTo(x, camTypeDict.LastValue, true); }
private void TransitTo(CameraModderParamsBase from, CameraModderParamsBase _toParams, bool isRelease) { if (from.GetType() == typeof(ThirdPersonCameraParams)) { if (_toParams.GetType() == typeof(ThirdPersonCameraParams)) { FromTpToTp(isRelease, _toParams as ThirdPersonCameraParams); } else if (_toParams.GetType() == typeof(FirstPersonCameraParams)) { FromTpToFp(isRelease, _toParams as FirstPersonCameraParams); } else if (_toParams.GetType() == typeof(FocusCameraParams)) { FromTpToFocus(isRelease, _toParams as FocusCameraParams); } else { Debug.Log("Camera transition doesnt exists"); } } else if (from.GetType() == typeof(FirstPersonCameraParams)) { if (_toParams.GetType() == typeof(ThirdPersonCameraParams)) { FromFpToTp(isRelease, _toParams as ThirdPersonCameraParams); } else if (_toParams.GetType() == typeof(FirstPersonCameraParams)) { FromFpToFp(isRelease, _toParams as FirstPersonCameraParams); } else { Debug.Log("Camera transition doesnt exists"); } } else if (from.GetType() == typeof(FocusCameraParams)) { if (_toParams.GetType() == typeof(ThirdPersonCameraParams)) { FromFocusToTp(isRelease, _toParams as ThirdPersonCameraParams); } else { Debug.Log("Camera transition doesnt exists"); } } }
public void OverrideCamera(CameraModderParamsBase _params, short priority, string id) { if (camTypeDict.IsOverridenWithKey(id)) { Debug.Log("Camera already overritten with this key (skipping camera override) :" + id.ToString()); return; } CameraModderParamsBase x = camTypeDict.LastValue; camTypeDict.Override(id, priority, _params); if (id == camTypeDict.LastId) { TransitTo(x, _params, true); } }
public void ChangePointerOfCamModderWithID(CameraModderParamsBase _newCamModderParam, string _modifierID) { if (!camTypeDict.IsOverridenWithKey(_modifierID)) { Debug.Log("No such key-id found, skipping param change... id: " + _modifierID); return; } camTypeDict.Modify(_modifierID, _newCamModderParam); if (_newCamModderParam.GetType() == typeof(ThirdPersonCameraParams)) { currentTPModderParams.Reset(); currentTPModderParams += _newCamModderParam as ThirdPersonCameraParams; } else if (_newCamModderParam.GetType() == typeof(FirstPersonCameraParams)) { currentFPModderParams.Reset(); currentFPModderParams += _newCamModderParam as FirstPersonCameraParams; } else if (_newCamModderParam.GetType() == typeof(FocusCameraParams)) { currentFocusModderParams = _newCamModderParam as FocusCameraParams; } }