This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class CarFollowSpline : MonoBehaviour | |
{ | |
public SplineST spline; | |
public float speed = 0.2f; | |
private float t = 0f; | |
Vector3 initialPosition; | |
Vector3 initialRotation; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public static class SaveLoad | |
{ | |
public static void SaveInt(string key, int value) => PlayerPrefs.SetInt(key, value); | |
public static void SaveFloat(string key, float value) => PlayerPrefs.SetFloat(key, value); | |
public static void SaveString(string key, string value) => PlayerPrefs.SetString(key, value); | |
public static int LoadInt(string key, int defaultValue = 0) => PlayerPrefs.GetInt(key, defaultValue); | |
public static float LoadFloat(string key, float defaultValue = 0f) => PlayerPrefs.GetFloat(key, defaultValue); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class CameraController : MonoBehaviour | |
{ | |
public float sensivity = 1f; | |
public Transform orientation; | |
float xRotation = 0f; | |
float yRotation = 0f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEditor; | |
using static System.IO.Directory; | |
using static System.IO.Path; | |
using static UnityEditor.AssetDatabase; | |
public class Setup : MonoBehaviour | |
{ | |
[MenuItem("Tools/Setup/Create Default Folders")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using UnityEngine; | |
public class Door : MonoBehaviour, ISwitchable | |
{ | |
private bool isActivated; | |
public bool IsActivated => isActivated; | |
public Switch switcher; | |
//Local angles for the door to open and close |