예제 #1
0
 public CameraShakeInstance UpdateImpactShakeInstance(GameCameraShakerSettingsComponent settings, CameraShakeInstance instance, CameraShakerConfigComponent cameraShakerConfig, Vector3 frontDir, float weakening)
 {
     if (this.ValidateShake(settings, cameraShakerConfig))
     {
         if (frontDir.magnitude < 0.005f)
         {
             return(instance);
         }
         ImpactAlignedInfluence influence = this.CalculateInfluence(frontDir, cameraShakerConfig);
         if (instance == null)
         {
             instance = this.cameraShaker.StartShake(cameraShakerConfig.Magnitude, cameraShakerConfig.Roughness, cameraShakerConfig.FadeInTime, influence.posInfluence, influence.rotInfluence);
             instance.deleteOnInactive = false;
         }
         instance.ScaleMagnitude    = weakening;
         instance.positionInfluence = influence.posInfluence;
         instance.rotationInfluence = influence.rotInfluence;
     }
     return(instance);
 }
예제 #2
0
 public CameraShakeInstance Shake(CameraShakeInstance shake)
 {
     this.cameraShakeInstances.Add(shake);
     return(shake);
 }