Ejemplo n.º 1
0
    public static void Shake(this Camera camera, ShakeAmount amount)
    {
        Vector3 displacement = Vector3.zero;
        if( amount == ShakeAmount.SMALL )

            displacement =  new Vector3(0.1f, 0.0f, 0.05f);
        else if( amount == ShakeAmount.MEDIUM )
            displacement =  new Vector3(0.2f, 0.0f, 0.2f);
        else if( amount == ShakeAmount.LARGE )
            displacement =  new Vector3(0.5f, 0.0f, 0.5f);

        iTween.ShakePosition(camera.transform.parent.gameObject, displacement, 0.3f );
    }
Ejemplo n.º 2
0
    public static void Shake(this Camera camera, ShakeAmount amount, float time = 0.3f)
    {
        Vector3 displacement = Vector3.zero;

        if (amount == ShakeAmount.SMALL)
        {
            displacement = new Vector3(0.1f, 0.1f, 0.0f);
        }
        else if (amount == ShakeAmount.MEDIUM)
        {
            displacement = new Vector3(0.2f, 0.2f, 0.0f);
        }
        else if (amount == ShakeAmount.LARGE)
        {
            displacement = new Vector3(0.5f, 0.5f, 0.0f);
        }

        Shake(camera, displacement, time);
    }
Ejemplo n.º 3
0
 public static Matrix GetViewMatrixLayer2()
 {
     return(Matrix.CreateTranslation(new Vector3((float)Math.Round(-PositionPoint.X * 0.75f + ShakeAmount.ToPoint().X), (float)Math.Round(-PositionPoint.Y + ShakeAmount.ToPoint().Y), 0f)));
 }