You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
914 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UltraCombos.Configuration;
public class CameraController : MonoBehaviour
{
[Config]
[Range(-5f, 5f)]
public float cam_x;
[Config]
[Range(5f, 10f)]
public float cam_y = 8f;
[Config]
[Range(0.05f, 0.5f)]
public float key_movement = 0.1f;
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.A))
{
cam_x -= key_movement;
}
else if (Input.GetKeyDown(KeyCode.D))
{
cam_x += key_movement;
}
else if (Input.GetKeyDown(KeyCode.W))
{
cam_y += key_movement;
}
else if (Input.GetKeyDown(KeyCode.S))
{
cam_y -= key_movement;
}
GetComponent<Transform>().position = new Vector3(cam_x, cam_y, 0);
}
}