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 UnityEngine.Events; | |
public class Money : MonoBehaviour | |
{ | |
[SerializeField] private int amount = 10000; | |
public static UnityAction<int> OnGrabbed; | |
public void Grab() | |
{ |
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; | |
using UnityEngine; | |
public class MyScript : MonoBehaviour | |
{ | |
public static MyScript Instance { get; private set; } | |
private void Awake() | |
{ | |
if (Instance != null) |
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
private static final String SOME_KEY = "KEY_ANYTHING_YOU_WANT" | |
public class Preference { | |
// Set Prefrence | |
SharedPreferences.Editor e = PreferenceManager.getDefaultSharedPreferences(context).edit(); | |
e.putBoolean(SOME_KEY, true); | |
e.apply(); | |
// Get Preference | |
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(SOME_KEY, false); |
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 UnityEngine.Events; | |
[CreateAssetMenu(menuName = "Variable/Int")] | |
public class IntVariable : ScriptableObject | |
{ | |
#if UNITY_EDITOR | |
[Multiline] | |
public string description; | |
#endif |
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 UnityEngine.Events; | |
[CreateAssetMenu(menuName = "Variable/Float")] | |
public class FloatVariable : ScriptableObject | |
{ | |
#if UNITY_EDITOR | |
[Multiline] | |
public string description; | |
#endif |
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
public class ImageFillSetter : MonoBehaviour { | |
public FloatReference Variable; | |
public FloatReference Max; | |
public Image image; | |
private void Update() { | |
Image.fillAmount = Mathf.Clamp(Variable.Value / Max.Value); | |
} | |
} |
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 TMPro; | |
using UnityEngine; | |
namespace Architecture | |
{ | |
[RequireComponent(typeof(TextMeshProUGUI))] | |
public class TextIntSetter : MonoBehaviour | |
{ | |
private TextMeshProUGUI textUI; | |
public IntVariable variable; |
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; | |
namespace Architecture | |
{ | |
public class IntLogger : MonoBehaviour | |
{ | |
public IntVariable variable; | |
public string textBeforeVariable; | |
public string textAfterVariable; |
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; | |
[CreateAssetMenu (menuName = "App Version")] | |
public sealed class AppVersion : ScriptableObject | |
{ | |
/// <summary> | |
/// Game Name | |
/// </summary> | |
[Header("Settings")] | |
[SerializeField] private string gameName; |
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; | |
[CreateAssetMenu(menuName = "Settings/Theme")] | |
public class GameTheme : ScriptableObject | |
{ | |
public Color foregroundColor; | |
public Color backgroundColor; | |
} |