예제 #1
0
파일: Fire.cs 프로젝트: yazici/FRONTIERS
        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;
        }
예제 #2
0
 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;
 }
예제 #3
0
        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);
        }