public override void GoToEndState() { GameSettings instance = GameSettings.Instance; if (this.Speed == EventAction_MoveCamera.CameraMoveSpeeds.Immediate) { EventAction_MoveCamera actionMoveCamera = this; actionMoveCamera.TargetPosition = Vector3.op_Addition(actionMoveCamera.TargetPosition, Vector3.op_Multiply(Vector3.get_up(), instance.GameCamera_UnitHeightOffset)); this.UpdateCameraPosition(1f); } else { TargetCamera targetCamera = TargetCamera.Get((Component)Camera.get_main()); targetCamera.Reset(); if (this.MoveMode == EventAction_MoveCamera.CameraMoveModes.InterpolateToPoint) { this.StartTargetPosition = targetCamera.TargetPosition; this.StartRotation = targetCamera.Yaw; this.StartCameraDistanceScale = targetCamera.CameraDistance / instance.GameCamera_DefaultDistance; } else if (this.MoveMode == EventAction_MoveCamera.CameraMoveModes.SpecificActor) { this.StartRotation = targetCamera.Yaw; this.StartTargetPosition = targetCamera.TargetPosition; this.StartCameraDistanceScale = targetCamera.CameraDistance / instance.GameCamera_DefaultDistance; GameObject actor = EventAction.FindActor(this.ActorID); if (Object.op_Equality((Object)actor, (Object)null)) { return; } this.TargetPosition = actor.get_transform().get_position(); if ((double)this.TargetRotation < 0.0) { this.TargetRotation = this.StartRotation; } } else { if (this.SnapToGround) { this.StartTargetPosition = GameUtility.RaycastGround(this.StartTargetPosition); } EventAction_MoveCamera actionMoveCamera = this; actionMoveCamera.StartTargetPosition = Vector3.op_Addition(actionMoveCamera.StartTargetPosition, Vector3.op_Multiply(Vector3.get_up(), instance.GameCamera_UnitHeightOffset)); } if (this.SnapToGround) { this.TargetPosition = GameUtility.RaycastGround(this.TargetPosition); } EventAction_MoveCamera actionMoveCamera1 = this; actionMoveCamera1.TargetPosition = Vector3.op_Addition(actionMoveCamera1.TargetPosition, Vector3.op_Multiply(Vector3.get_up(), instance.GameCamera_UnitHeightOffset)); this.UpdateCameraPosition(2f); } }
public override void OnActivate() { GameSettings instance = GameSettings.Instance; if ((double)this.MoveTime <= 0.0 && this.Speed == EventAction_MoveCamera.CameraMoveSpeeds.Immediate) { EventAction_MoveCamera actionMoveCamera = this; actionMoveCamera.TargetPosition = Vector3.op_Addition(actionMoveCamera.TargetPosition, Vector3.op_Multiply(Vector3.get_up(), instance.GameCamera_UnitHeightOffset)); this.UpdateCameraPosition(1f); this.ActivateNext(); } else { TargetCamera targetCamera = TargetCamera.Get((Component)Camera.get_main()); targetCamera.Reset(); if (this.MoveMode == EventAction_MoveCamera.CameraMoveModes.InterpolateToPoint) { this.StartTargetPosition = targetCamera.TargetPosition; this.StartRotation = targetCamera.Yaw; this.StartCameraDistanceScale = targetCamera.CameraDistance / GameSettings.Instance.GameCamera_DefaultDistance; } else if (this.MoveMode == EventAction_MoveCamera.CameraMoveModes.SpecificActor) { this.StartRotation = targetCamera.Yaw; this.StartTargetPosition = targetCamera.TargetPosition; this.StartCameraDistanceScale = targetCamera.CameraDistance / GameSettings.Instance.GameCamera_DefaultDistance; GameObject actor = EventAction.FindActor(this.ActorID); if (Object.op_Equality((Object)actor, (Object)null)) { this.ActivateNext(); return; } this.TargetPosition = actor.get_transform().get_position(); if ((double)this.TargetRotation < 0.0) { this.TargetRotation = this.StartRotation; } } else { if (this.SnapToGround) { this.StartTargetPosition = GameUtility.RaycastGround(this.StartTargetPosition); } EventAction_MoveCamera actionMoveCamera = this; actionMoveCamera.StartTargetPosition = Vector3.op_Addition(actionMoveCamera.StartTargetPosition, Vector3.op_Multiply(Vector3.get_up(), instance.GameCamera_UnitHeightOffset)); } if (this.SnapToGround) { this.TargetPosition = GameUtility.RaycastGround(this.TargetPosition); } EventAction_MoveCamera actionMoveCamera1 = this; actionMoveCamera1.TargetPosition = Vector3.op_Addition(actionMoveCamera1.TargetPosition, Vector3.op_Multiply(Vector3.get_up(), instance.GameCamera_UnitHeightOffset)); float num1 = 1f; switch (this.Speed) { case EventAction_MoveCamera.CameraMoveSpeeds.Normal: num1 = 2f; break; case EventAction_MoveCamera.CameraMoveSpeeds.Fast: num1 = 8f; break; case EventAction_MoveCamera.CameraMoveSpeeds.Slow: num1 = 0.5f; break; } this.mCurrentTime = 0.0f; if ((double)this.MoveTime <= 0.0) { Vector3 vector3 = Vector3.op_Subtraction(this.TargetPosition, this.StartTargetPosition); // ISSUE: explicit reference operation float num2 = ((Vector3)@vector3).get_magnitude(); if ((double)num2 <= 0.0) { if ((double)this.StartCameraDistanceScale == (double)this.CameraDistanceScale) { this.UpdateCameraPosition(1f); this.ActivateNext(); return; } num2 = 1f; } this.mEndTime = num2 / num1; } else { this.mEndTime = this.MoveTime; } if (!this.Async) { return; } this.ActivateNext(true); } }