public void Ignite() { if (SmokeObject != null) { GameObject.DestroyImmediate(SmokeObject); } if (FireObject == null) { if (FireObjectTemplate == null) { FireObjectTemplate = FXManager.Get.SpawnFire(Type.ToString(), transform, Offset, Vector3.zero, FireScale, false); } FireObject = GameObject.Instantiate(FireObjectTemplate) as GameObject; FireObject.transform.parent = tr; FireObject.transform.localPosition = Offset; ParticleEmitters.AddRange(tr.GetComponentsInChildren <ParticleEmitter>()); } if (FireLight == null) { FireLight = LightManager.GetWorldLight("CampfireLight", transform, Offset, true, WorldLightType.AlwaysOn); //this will turn the light into a proper fire light FireLight.ParentFire = this; } ThermalState = GooThermalState.Burning; }
public void SetWeaponTooltip(string name, int cost, int maxAmmo, FireType type) { nameText.text = name; costText.text = $"${cost.ToString()}"; descriptionText.text = $"{type.ToString()} | Max Ammo:{maxAmmo}"; messageText.text = string.Empty; }
public GameObject SpawnFire(FireType fireType, Transform fireParent, Vector3 position, Vector3 rotation, float scale, bool justForLooks) { GameObject firePrefab = null; for (int i = 0; i < FirePrefabs.Count; i++) { if (FirePrefabs [i].name.Equals(fireType.ToString(), StringComparison.OrdinalIgnoreCase)) { firePrefab = FirePrefabs [i]; break; } } GameObject instantiatedFire = GameObject.Instantiate(firePrefab) as GameObject; instantiatedFire.transform.parent = fireParent; instantiatedFire.transform.localPosition = position; instantiatedFire.transform.localRotation = Quaternion.Euler(rotation); return(instantiatedFire); }