Skip to content

Instantly share code, notes, and snippets.

View mecha-moonboy's full-sized avatar
🧙‍♂️
Creating

mecha_moonboy mecha-moonboy

🧙‍♂️
Creating
View GitHub Profile
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MoveAroundObject : MonoBehaviour
{
[SerializeField]
private float _mouseSensitivity = 3.0f;
private float _rotationY;
@jacg311
jacg311 / Config.java
Created January 6, 2023 21:37
small config with gson
public class Config {
private static Gson GSON = new GsonBuilder().setPrettyPrinting().create(); // got a bunch of cool config options
int someIntValue = 5; // field where the values will be held, default value would be 5
String aString = "hello world"; // lots of standard types work, you can always register new deserializers in your GSON instance. google it.
public static Config readConfig() {
Path configFile = FabricLoader.getInstance().getConfigDir().resolve("filename.json");
try {
// read file contents and let gson construct an instance of it