Esempio n. 1
0
 public override void FireEvent()
 {
     this.shake = base.AffectedObject.GetComponent <_CameraShake>();
     if (this.shake == null)
     {
         this.shake = base.AffectedObject.AddComponent <_CameraShake>();
     }
     this.shake.DoShake(this.numberOfShakes, this.shakeAmount, this.rotateAmount, this.distance, this.speed, this.decay, 1f, false);
 }
Esempio n. 2
0
 private void OnEnable()
 {
     if (this.cameras.Count < 1 && base.GetComponent <Camera>())
     {
         this.cameras.Add(base.GetComponent <Camera>());
     }
     if (this.cameras.Count < 1 && Camera.main)
     {
         this.cameras.Add(Camera.main);
     }
     if (this.cameras.Count < 1)
     {
         LogSystem.LogWarning(new object[]
         {
             "Camera Shake: No cameras assigned in the inspector!"
         });
     }
     _CameraShake.instance = this;
 }
Esempio n. 3
0
    private void OnEnable()
    {
        if (cameras.Count < 1)
        {
            if (GetComponent <Camera>())
            {
                cameras.Add(GetComponent <Camera>());
            }
        }

        if (cameras.Count < 1)
        {
            if (Camera.main)
            {
                cameras.Add(Camera.main);
            }
        }

        if (cameras.Count < 1)
        {
            LogSystem.LogError("Camera Shake: No cameras assigned in the inspector!");
        }
        instance = this;
    }