public void OnApplicationStart() { _harmony = new Harmony("com.Snow1226.Rakugaki"); _harmony.PatchAll(Assembly.GetExecutingAssembly()); Logger.log.Debug("OnApplicationStart"); rakugakiController = new GameObject("RakugakiController").AddComponent <RakugakiController>(); }
public void init(RakugakiController instance) { _rakugakiParent = instance; _vrPointer = GetComponent <VRPointer>(); Logger.log?.Debug($"{name}: init()"); if (_vrPointer == null) { Logger.log?.Debug($"{name}: vrPointer Null"); } _triggerTime = 0; }
private void Awake() { if (instance != null) { Logger.log?.Warn($"Instance of {this.GetType().Name} already exists, destroying."); GameObject.DestroyImmediate(this); return; } GameObject.DontDestroyOnLoad(this); // Don't destroy this object on scene changes instance = this; Logger.log?.Debug($"{name}: Awake()"); MenuButton menuButton = new MenuButton( "Rakugaki", "scribble mod", ShowModFlowCoordinator, true); MenuButtons.instance.RegisterButton(menuButton); }
private void OnDestroy() { Logger.log?.Debug($"{name}: OnDestroy()"); instance = null; // This MonoBehaviour is being destroyed, so set the static instance property to null. }