public void MoveCamFoV(GUICamZoom pos, float camTime, float camDelay, System.Action camCompleteAction) { ScionPostProcessNoTonemap spp = mainCam.GetComponent <ScionPostProcessNoTonemap> (); float endCamFoV = 0f; float oriCamFoV = mainCam.fieldOfView; float oriCamFocal = 85f; float endCamFocal = 0f; if (spp != null) { oriCamFocal = spp.focalLength; } onCamFoVComplete = camCompleteAction; if (pos == GUICamZoom.Original) { endCamFoV = oriFoV; endCamFocal = oriFocal; } else if (pos == GUICamZoom.In) { endCamFoV = zoomInFoV; endCamFocal = 0f; } else if (pos == GUICamZoom.Increase) { endCamFoV = mainCam.fieldOfView + deltaFoV; endCamFocal = 0f; } else if (pos == GUICamZoom.Decrease) { endCamFoV = mainCam.fieldOfView - deltaFoV; endCamFocal = 0f; } iTween.ValueTo(gameObject, iTween.Hash("from", oriCamFoV, "to", endCamFoV, "time", camTime, "delay", camDelay, "onupdate", "OnCamFoVUpdate", "oncomplete", "OnCamFoVComplete", "oncompletetarget", gameObject, "ignoretimescale", (Time.timeScale == 0f), "easetype", "easeInOutSmoothBreak")); if (spp != null) { iTween.ValueTo(gameObject, iTween.Hash("from", oriCamFocal, "to", endCamFocal, "time", camTime, "delay", camDelay, "onupdate", "OnCamFocalUpdate", "ignoretimescale", (Time.timeScale == 0f), "easetype", "easeInOutSmoothBreak")); } }
public void SetCamFoV(GUICamZoom zoom) { ScionPostProcessNoTonemap spp = mainCam.GetComponent <ScionPostProcessNoTonemap> (); if (zoom == GUICamZoom.Original) { mainCam.fieldOfView = oriFoV; if (spp != null) { spp.focalLength = oriFocal; } } else if (zoom == GUICamZoom.In) { mainCam.fieldOfView = zoomInFoV; if (spp != null) { mainCam.GetComponent <ScionPostProcessNoTonemap> ().focalLength = 0; } } }