-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class AnimateCockpitControls : MonoBehaviour | ||
{ | ||
//flight control transforms | ||
[SerializeField] | ||
private Transform _joystick; | ||
|
||
[SerializeField] | ||
Vector3 _joystickRange = Vector3.zero; | ||
|
||
[SerializeField] | ||
List<Transform> _throttles; | ||
|
||
[SerializeField] | ||
float _throttleRange = 35f; | ||
|
||
[SerializeField] | ||
private ShipMovementInput _movementInput; | ||
|
||
private IMovementControls ControlInput => _movementInput.MovementControls; | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
_joystick.localRotation = Quaternion.Euler(ControlInput.PitchAmount * _joystickRange.x, ControlInput.YawAmount *_joystickRange.y,ControlInput.RollAmount * _joystickRange.z); | ||
|
||
Vector3 throttleRotation = _throttles[0].localRotation.eulerAngles; | ||
throttleRotation.x = ControlInput.ThrustAmount * _throttleRange; | ||
foreach (Transform throttle in _throttles) | ||
{ | ||
throttle.localRotation = Quaternion.Euler(throttleRotation); | ||
} | ||
} | ||
|
||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class GameManager : MonoBehaviour | ||
{ | ||
private bool ShouldQuitGame => Input.GetKeyUp(KeyCode.Escape); | ||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
Cursor.lockState = CursorLockMode.Confined; | ||
Cursor.visible = false; | ||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
if (ShouldQuitGame) | ||
{ | ||
ShouldGame(); | ||
} | ||
} | ||
|
||
private void ShouldGame() | ||
{ | ||
#if UNITY_EDITOR | ||
UnityEditor.EditorApplication.isPlaying = false; | ||
#else | ||
// todo handle WedGL | ||
Application.Quit(); | ||
#endif | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class Managers : MonoBehaviour | ||
{ | ||
private static Managers _instance; | ||
|
||
private void Awake() | ||
{ | ||
if (_instance != null && _instance != this) | ||
{ | ||
Destroy(this.gameObject); | ||
} | ||
else | ||
{ | ||
_instance = this; | ||
DontDestroyOnLoad(this.gameObject); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class MatchRotation : MonoBehaviour | ||
{ | ||
[SerializeField] public Transform _target; | ||
// Start is called before the first frame update | ||
|
||
private void LateUpdate() | ||
{ | ||
transform.rotation = _target.rotation; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.