Exemplo n.º 1
0
		protected void DoShake (MainCamera mainCam, float _intensity, float _duration)
		{
			if (mainCam.attachedCamera is GameCamera)
			{
				mainCam.Shake (_intensity / 67f, _duration, cameraShakeEffect, intensityCurve);
			}
			else if (mainCam.attachedCamera is GameCamera25D)
			{
				mainCam.Shake (_intensity / 67f, _duration, cameraShakeEffect, intensityCurve);
				
				GameCamera25D gameCamera = (GameCamera25D) mainCam.attachedCamera;
				if (gameCamera.backgroundImage)
				{
					gameCamera.backgroundImage.Shake (_intensity / 0.67f, _duration, intensityCurve);
				}
			}
			else if (mainCam.attachedCamera is GameCamera2D)
			{
				mainCam.Shake (_intensity / 33f, _duration, cameraShakeEffect, intensityCurve);
			}
			else
			{
				mainCam.Shake (_intensity / 67f, _duration, cameraShakeEffect, intensityCurve);
			}
		}
        private void DoShake(MainCamera mainCam, float _intensity, float _duration)
        {
            if (mainCam.attachedCamera is GameCamera)
            {
                mainCam.Shake(_intensity / 67f, _duration, true);
            }

            else if (mainCam.attachedCamera is GameCamera25D)
            {
                mainCam.Shake(_intensity / 67f, _duration, true);

                GameCamera25D gameCamera = (GameCamera25D)mainCam.attachedCamera;
                if (gameCamera.backgroundImage)
                {
                    gameCamera.backgroundImage.Shake(_intensity / 0.67f, _duration);
                }
            }

            else if (mainCam.attachedCamera is GameCamera2D)
            {
                mainCam.Shake(_intensity / 33f, _duration, false);
            }

            else
            {
                mainCam.Shake(_intensity / 67f, _duration, false);
            }
        }
Exemplo n.º 3
0
        override public float Run()
        {
            MainCamera mainCam = KickStarter.mainCamera;

            if (mainCam)
            {
                if (!isRunning)
                {
                    isRunning = true;

                    if (mainCam.attachedCamera is GameCamera)
                    {
                        mainCam.Shake((float)shakeIntensity / 67f, duration, true);
                    }

                    else if (mainCam.attachedCamera is GameCamera25D)
                    {
                        mainCam.Shake((float)shakeIntensity / 67f, duration, true);

                        GameCamera25D gameCamera = (GameCamera25D)mainCam.attachedCamera;
                        if (gameCamera.backgroundImage)
                        {
                            gameCamera.backgroundImage.Shake(shakeIntensity / 0.67f, duration);
                        }
                    }

                    else if (mainCam.attachedCamera is GameCamera2D)
                    {
                        mainCam.Shake((float)shakeIntensity / 33f, duration, false);
                    }

                    else
                    {
                        mainCam.Shake((float)shakeIntensity / 67f, duration, false);
                    }

                    if (willWait)
                    {
                        return(duration);
                    }
                }
                else
                {
                    isRunning = false;
                    return(0f);
                }
            }

            return(0f);
        }
Exemplo n.º 4
0
        private void DoShake(MainCamera mainCam, float _intensity, float _duration)
        {
            if (mainCam.attachedCamera is GameCamera)
            {
                mainCam.Shake (_intensity / 67f, _duration, true);
            }

            else if (mainCam.attachedCamera is GameCamera25D)
            {
                mainCam.Shake (_intensity / 67f, _duration, true);

                GameCamera25D gameCamera = (GameCamera25D) mainCam.attachedCamera;
                if (gameCamera.backgroundImage)
                {
                    gameCamera.backgroundImage.Shake (_intensity / 0.67f, _duration);
                }
            }

            else if (mainCam.attachedCamera is GameCamera2D)
            {
                mainCam.Shake (_intensity / 33f, _duration, false);
            }

            else
            {
                mainCam.Shake (_intensity / 67f, _duration, false);
            }
        }