Skip to content

Commit

Permalink
Better Readme and code
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickk888SAMP committed Oct 9, 2022
1 parent f237b24 commit 01a41f3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,18 @@ The script controlls the Target and the Virtual Camera.
* RTS Style Zoom
* RTS Style "WASD" Camera Movement
* RTS Style Mouse "Drag" Camera Movement
* UI Controller (Compas, Zoom Slider, Drag Images, Rotate Image)
* UI Controller (Compas, Zoom Slider, Drag Images, Rotate Image)

## Requirement
* Cinemachine
* Old Input System

## How To Use
* IMPORTANT: Make sure you have installed Cinemachine before importing!
Delete the Camera from the Scene (If exists).
Place the "RTSCameraController" (located in the "Prefabs" directory) to your Scene.
That's all.

WASD or Middle Mouse Button - Camera Movement
Right Mouse Button - Rotation
Mouse Scroll Wheel - Zoom-In/Zoom-Out
12 changes: 6 additions & 6 deletions Scripts/RTSCameraTargetController.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Cinemachine;
Expand Down Expand Up @@ -54,12 +52,10 @@ [Space] [Header("Rotate Camera Canvas")]
[SerializeField]
private GameObject compasUImageGameObject;



private Vector3 mouseLockPos;
private Camera cam;
private CinemachineFramingTransposer framingTransposer;
private GameObject virtualCameraGameObject;
Vector3 mouseLockPos;
Camera cam;
private float cameraZoomSmoothDamp;
private float cameraZoomSmoothDampVel_ref;
private float RotateFlipSmoothDampVel_ref;
Expand All @@ -85,6 +81,10 @@ private void OnEnable()
{
Debug.LogError("Rotate Camera Canvas Game Object not applied!");
}
if(compasUImageGameObject == null)
{
Debug.LogError("Compas UI Image Game Object not applied!");
}
}

private void Awake()
Expand Down

0 comments on commit 01a41f3

Please sign in to comment.