Skip to content

Instantly share code, notes, and snippets.

@MysticFragilist
Last active May 31, 2020 17:51
Show Gist options
  • Save MysticFragilist/a31ae59f68125185689bbb193eaae5a6 to your computer and use it in GitHub Desktop.
Save MysticFragilist/a31ae59f68125185689bbb193eaae5a6 to your computer and use it in GitHub Desktop.
A sample of a Game Manager script to embed in Medium
using System.Collections;
using System.Collections.Generic;
using Cinemachine;
using UnityEngine;
using UnityEngine.InputSystem;
[RequireComponent(typeof(CinemachineFreeLook))]
public class FreeLookAddOn : MonoBehaviour
{
[Range(0f, 10f)] public float LookSpeed = 1f;
public bool InvertY = false;
private CinemachineFreeLook _freeLookComponent;
public void Start()
{
_freeLookComponent = GetComponent<CinemachineFreeLook>();
}
// Update the look movement each time the event is trigger
public void OnLook(InputAction.CallbackContext context)
{
//TODO: Add the logic for Looking with the camera
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment