public void Awake() { Instance = this; This_Cyclops_Root = gameObject; subroot = This_Cyclops_Root.GetComponent <SubRoot>(); subcontrol = This_Cyclops_Root.GetComponent <SubControl>(); Main.onConfigurationChanged.AddHandler(this, new Event <string> .HandleFunction(OnConfigurationChanged)); CreateCannonCamera(); CreateCannonButton(); CreateCannonRight(); CreateCannonLeft(); LaserCannonSetActive(false); GameObject laser_sound = Instantiate(Main.assetBundle.LoadAsset <GameObject>("turret_sound"), CannonCamPosition.transform); audioSource = laser_sound.GetComponent <AudioSource>(); SetOnlyHostile(); SetLaserStrength(); SetLaserSFXVolume(); SetWarningMessage(); }
private IEnumerator GetMCUHandler() { SNLogger.Debug("CyclopsLaserCannonModule", $"GetMCUHandler coroutine started for this Cyclops: {This_Cyclops_Root.GetInstanceID()}"); while (upgradeHandler == null) { upgradeHandler = MCUServices.Find.CyclopsUpgradeHandler(subroot, CannonPrefab.TechTypeID); SNLogger.Debug("CyclopsLaserCannonModule", $"MCU UpgradeHandler is not ready for this Cyclops: {This_Cyclops_Root.GetInstanceID()}"); yield return(null); } SNLogger.Debug("CyclopsLaserCannonModule", $"MCU UpgradeHandler is ready for this Cyclops: {This_Cyclops_Root.GetInstanceID()}"); upgradeHandler.OnFinishedUpgrades = OnFinishedUpgrades; upgradeHandler.OnClearUpgrades = OnClearUpgrades; OnFirstTimeCheckModuleIsExists(); SNLogger.Debug("CyclopsLaserCannonModule", $"GetMCUHandler coroutine stopped for this Cyclops: {This_Cyclops_Root.GetInstanceID()}"); yield break; }