private void RoR2Application_Awake(On.RoR2.RoR2Application.orig_Awake orig, RoR2Application self) { orig(self); if (!self.GetComponent <RadarEffectToggleModComponent>()) { var component = self.gameObject.AddComponent <RadarEffectToggleModComponent>(); component.prefab = Resources.Load <GameObject>("prefabs/effects/ActivateRadarTowerEffect"); if (PostProcessing.Value || Kill.Value) { component.prefab.transform.Find("PP").gameObject.SetActive(false); } if (PointLight.Value || Kill.Value) { component.prefab.transform.Find("Point Light").gameObject.SetActive(false); } if (Shake.Value || Kill.Value) { foreach (var shakers in component.prefab.GetComponents <ShakeEmitter>()) { shakers.enabled = false; } } if (Kill.Value) { component.prefab.GetComponent <DestroyOnTimer>().duration = 0f; } } }
private void CheckIfUsedOnRightGameVersion(On.RoR2.RoR2Application.orig_Awake orig, RoR2Application self) { orig(self); var buildId = Application.version; if (GameBuildId == buildId) { return; } Logger.LogWarning($"This version of R2API was built for build id \"{GameBuildId}\", you are running \"{buildId}\"."); Logger.LogWarning("Should any problems arise, please check for a new version before reporting issues."); }
private void RoR2Application_Awake(On.RoR2.RoR2Application.orig_Awake orig, RoR2.RoR2Application self) { orig(self); UnityEngine.Debug.Log("STUFF IS HAPPENING"); }