예제 #1
0
 // Start is called before the first frame update
 private void Start()
 {
     fireManager         = FindObjectOfType <FireSystemManager>();
     fireParticleSystems = GetComponentsInChildren <ParticleSystem>();
     particleStartSize   = new float[fireParticleSystems.Length];
     for (int i = 0; i < fireParticleSystems.Length; i++)
     {
         particleStartSize[i] = fireParticleSystems[i].main.startSize.constant;
     }
     fireLight       = GetComponentInChildren <Light>();
     timeIgnited     = 0f;
     lifeRemaining   = lifeSpanSeconds;
     startFireRadius = GetComponent <SphereCollider>().radius;
     try
     {
         GameObject ashes = fireManager.GetMaterialProperties(GetComponentInParent <Renderer>().sharedMaterial).ashesPrefab;
         if (ashes != null)
         {
             ashesRenderer         = Instantiate(ashes, transform.position, transform.rotation, transform).GetComponentInChildren <Renderer>();
             ashesRenderer.enabled = false;
         }
     }
     catch (NullReferenceException e)
     {
         Debug.LogException(e);
     }
 }
예제 #2
0
    // Start is called before the first frame update
    protected virtual void Start()
    {
        fireManager         = FindObjectOfType <FireSystemManager>();
        fireParticleSystems = GetComponentsInChildren <ParticleSystem>();
        particleStartSize   = new float[fireParticleSystems.Length];
        for (int i = 0; i < fireParticleSystems.Length; i++)
        {
            particleStartSize[i] = fireParticleSystems[i].main.startSize.constant;
        }
        fireLight = GetComponentInChildren <Light>();

        currentFuel = starterFuel;
    }
 // Start is called before the first frame update
 void Start()
 {
     fireManager = FindObjectOfType <FireSystemManager>();
 }