Example #1
0
 private void FreeCameraManager()
 {
     if (isActiveFreeCamera)
     {
         FreeCam freeCam = GameObject.FindGameObjectWithTag("CameraFree").GetComponent <FreeCam>();
         isActiveFreeCamera       = false;
         freeCam.Freecamera       = isActiveFreeCamera;
         playerController.enabled = true;
     }
 }
Example #2
0
    void Awake()
    {
        FreeCam fc = GetComponent <FreeCam>();

        fc.SetPosition(Position);
        fc.SetRotation(Quaternion.Euler(RotationEuler));
        fc.SetZoom(Zoom);

        FreeCam.InputMode IM = fc.Mode;
        if (fc.Mode == FreeCam.InputMode.Automatic)
        {
            IM = FreeCam.ResolveAutomaticInputMode();
        }

        fc.SetSensitivity(IM == FreeCam.InputMode.Mouse ? SensitivityMouse : SensitivityTouch);
    }
Example #3
0
        protected override void LoadContent()
        {
            //New camara
            tankCam = new TankCam(GraphicsDevice);
            camSF   = new CamSF(GraphicsDevice, /*Speed*/ 0.005f);
            freeCam = new FreeCam(GraphicsDevice, /*Speed*/ 0.005f);

            //New mapa
            map = new Map(GraphicsDevice, Content.Load <Texture2D>("map"), Content.Load <Texture2D>("terrainTexture"), 0.05f, 100);

            //New tank
            tank = new Tank(GraphicsDevice, Content.Load <Model>("tank\\tank"), Content.Load <Model>("tank\\bala"), 0.001f, new Vector3(50.0f, 10.0f, 50.0f));

            //New enemy tank
            enemyTank = new Tank(GraphicsDevice, Content.Load <Model>("tank\\tank"), Content.Load <Model>("tank\\bala"), 0.001f, new Vector3(50.0f, 10.0f, 51.0f));

            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
        }