https://divillysausages.com/2016/01/21/performance-tips-for-unity-2d-mobile/
https://github.com/maiisalihu/NatCam-VR-Cardboard
https://www.orduh.com/fix-samsung-galaxy-s7-battery-drain-overheating/
public class MainComponentManger { private static MainComponentManger instance; public static void CreateInstance () { if (instance == null) { instance = new MainComponentManger (); GameObject go = GameObject.Find ("Main"); if (go == null) { go = new GameObject ("Main"); instance.main = go; // important: make game object persistent: Object.DontDestroyOnLoad (go); } // trigger instantiation of other singletons Component c = MenuManager.SharedInstance; // ... } } GameObject main; public static MainComponentManger SharedInstance { get { if (instance == null) { CreateInstance (); } return instance; } } public static T AddMainComponent <T> () where T : UnityEngine.Component { T t = SharedInstance.main.GetComponent<T> (); if (t != null) { return t; } return SharedInstance.main.AddComponent <T> (); }
public class AudioManager : MonoBehaviour { private static AudioManager instance = null; public static AudioManager SharedInstance { get { if (instance == null) { instance = MainComponentManger.AddMainComponent<AudioManager> (); } return instance; } }
——————————————————-
using UnityEngine; using System.Collections; public class Argos_Heart:MonoBehaviour { public static Argos_Heart inst; [HideInInspector] public static Radiator radiator; public static Sensor sensor; public static Argos_Heart Inst { get { if (inst == null) { inst = new Argos_Heart(); } return inst; } } void Awake() { inst = this; radiator = new Radiator(); sensor = new Sensor(); } void Start() { } }
https://youtu.be/u4VtCgORAyc