void SetupCMType() { countermeasureType = countermeasureType.ToLower(); switch (countermeasureType) { case "flare": cmType = CountermeasureTypes.Flare; break; case "chaff": cmType = CountermeasureTypes.Chaff; break; case "smoke": cmType = CountermeasureTypes.Smoke; break; } }
void SetupCM() { countermeasureType = countermeasureType.ToLower(); switch (countermeasureType) { case "flare": cmType = CountermeasureTypes.Flare; cmSound = GameDatabase.Instance.GetAudioClip("BDArmory/Sounds/flareSound"); if (!flarePool) { SetupFlarePool(); } resourceName = "CMFlare"; break; case "chaff": cmType = CountermeasureTypes.Chaff; cmSound = GameDatabase.Instance.GetAudioClip("BDArmory/Sounds/smokeEject"); resourceName = "CMChaff"; vci = vessel.gameObject.GetComponent <VesselChaffInfo>(); if (!vci) { vci = vessel.gameObject.AddComponent <VesselChaffInfo>(); } if (!chaffPool) { SetupChaffPool(); } break; case "smoke": cmType = CountermeasureTypes.Smoke; cmSound = GameDatabase.Instance.GetAudioClip("BDArmory/Sounds/smokeEject"); smokePoofSound = GameDatabase.Instance.GetAudioClip("BDArmory/Sounds/smokePoof"); resourceName = "CMSmoke"; if (smokePool == null) { SetupSmokePool(); } break; } }
void SetupCM() { countermeasureType = countermeasureType.ToLower(); switch(countermeasureType) { case "flare": cmType = CountermeasureTypes.Flare; cmSound = GameDatabase.Instance.GetAudioClip("BDArmory/Sounds/flareSound"); if(!flarePool) { SetupFlarePool(); } resourceName = "CMFlare"; break; case "chaff": cmType = CountermeasureTypes.Chaff; cmSound = GameDatabase.Instance.GetAudioClip("BDArmory/Sounds/smokeEject"); resourceName = "CMChaff"; vci = vessel.GetComponent<VesselChaffInfo>(); if(!vci) { vci = vessel.gameObject.AddComponent<VesselChaffInfo>(); } if(!chaffPool) { SetupChaffPool(); } break; case "smoke": cmType = CountermeasureTypes.Smoke; cmSound = GameDatabase.Instance.GetAudioClip("BDArmory/Sounds/smokeEject"); smokePoofSound = GameDatabase.Instance.GetAudioClip("BDArmory/Sounds/smokePoof"); resourceName = "CMSmoke"; if(smokePool == null) { SetupSmokePool(); } break; } }