Exemplo n.º 1
0
    /// <summary>
    /// Adjust the current camera
    /// </summary>
    void AdjustCamera()
    {
        //switch camera between 2D and 3D
        if (is2D)
        {
            camera3D.gameObject.SetActive(false);
            camera2D.gameObject.SetActive(true);

            Vector3 newPos = new Vector3(0, 0, -1);
            if (mode != 0)
            {
                newPos = new Vector3(FirstTilePosition().x, FirstTilePosition().y, -1);
            }

            camera2D.transform.localPosition = newPos;
        }
        //adjust the camera in 3D
        else
        {
            camera2D.gameObject.SetActive(false);
            camera3D.gameObject.SetActive(true);

            if (mode == 0)
            {
                camera3D.AdjustPosition(new Vector2(0, 0));
            }
            else
            {
                camera3D.AdjustPosition(FirstTilePosition());
            }
        }
    }
Exemplo n.º 2
0
 void LoadTileToCell(HexCell cell, int collection, int tier, int index, Vector3 position, int visionRad, TileInfo info)
 {
     hexGrid.LoadAndSetTile(cell,
                            collection,
                            tier,
                            index,
                            position,
                            visionRad,
                            info);
     hexMapCamera.AdjustPosition(cell.transform.localPosition);
 }
Exemplo n.º 3
0
 public static void ValidatePosition()
 {
     if (instance != null)
     {
         instance.AdjustPosition(0f, 0f);
     }
 }
Exemplo n.º 4
0
    public static void Move()
    {
        float xDelta = Input.GetAxis("Horizontal");
        float zDelta = Input.GetAxis("Vertical");

        if (xDelta != 0f || zDelta != 0f)
        {
            instance.AdjustPosition(xDelta, zDelta);
        }
    }
Exemplo n.º 5
0
 public static void ValidatePostion()
 {
     instance.AdjustPosition(0f, 0f);
 }
Exemplo n.º 6
0
 public static void ValidatePosition()
 {
     instance.AdjustPosition(470f, 300f);
 }