public void AddFuel(Flammable fuel)
 {
     if (showDebug)
     {
         Debug.Log(base.name + " Add Fuel ");
     }
     if (flammableList.Contains(fuel))
     {
         return;
     }
     flammableList.Add(fuel);
     flammbleElementCount++;
     if (isHot)
     {
         if (showDebug)
         {
             Debug.Log(base.name + " Going to change the colour of the fuel ");
         }
         FlammableScriptHeatColourChange1 component = fuel.GetComponent <FlammableScriptHeatColourChange1>();
         if (component != null)
         {
             component.Ignite();
         }
     }
     UpdateValue();
 }
Exemple #2
0
    public void OnTriggerEnter(Collider other)
    {
        if (showDebug)
        {
            Debug.Log(base.name + " Entered Range " + other.name);
        }
        FlammableScriptHeatSource1 component = other.gameObject.GetComponent <FlammableScriptHeatSource1>();

        if ((bool)component)
        {
            if (showDebug)
            {
                Debug.Log(base.name + " Pass on the Heat ");
            }
            component.Ignite();
        }
        FlammableScriptHeatColourChange1 component2 = other.gameObject.GetComponent <FlammableScriptHeatColourChange1>();

        if (component2 != null && ignited)
        {
            if (showDebug)
            {
                Debug.Log(base.name + " The other thing here is supposed to change colour");
            }
            component2.Ignite();
        }
        Flammable component3 = other.gameObject.GetComponent <Flammable>();

        if ((bool)component3)
        {
            if (showDebug)
            {
                Debug.Log(base.name + " The other thing is flammable , its supposed to get hot ");
            }
            component3.heat = 1f;
        }
        Flame component4 = other.gameObject.GetComponent <Flame>();

        if ((bool)component4)
        {
            if (showDebug)
            {
                Debug.Log(base.name + " The other thing is flammable , its supposed to get hot ");
            }
            component4.Ignite();
        }
    }
 public void RemoveFuel(Flammable fuel)
 {
     if (showDebug)
     {
         Debug.Log(base.name + " Remove fuel ");
     }
     flammableList.Remove(fuel);
     flammbleElementCount--;
     if (isHot)
     {
         FlammableScriptHeatColourChange1 component = fuel.GetComponent <FlammableScriptHeatColourChange1>();
         component.Extinguish();
         if (flammableList.Count == 0 && flameList.Count == 0)
         {
             isHot = false;
         }
     }
     UpdateValue();
 }
 public void Ignite()
 {
     if (showDebug)
     {
         Debug.Log(base.name + " Ignite ");
     }
     isHot = true;
     flameElementCount++;
     if (flammableList.Count != 0)
     {
         if (showDebug)
         {
             Debug.Log(base.name + " Flammable list is not 0 ");
             Debug.Log(base.name + " flammableList.Count =" + flammableList.Count);
         }
         for (int i = 0; i < flammableList.Count; i++)
         {
             Flammable flammable = flammableList[i];
             FlammableScriptHeatColourChange1 component = flammable.GetComponent <FlammableScriptHeatColourChange1>();
             if (showDebug)
             {
                 Debug.Log(base.name + " Doing Entry " + i);
             }
             if (component != null)
             {
                 component.Ignite();
             }
         }
     }
     if (flameList.Count != 0)
     {
         for (int j = 0; j < flameList.Count; j++)
         {
             flameList[j].Ignite();
         }
     }
     if (showDebug)
     {
         Debug.Log(base.name + " flameElementCount = " + flameElementCount);
     }
     UpdateValue();
 }
 public void Extinguish()
 {
     if (flameList.Count != 0)
     {
         return;
     }
     for (int i = 0; i < flammableList.Count; i++)
     {
         Flammable flammable = flammableList[i];
         FlammableScriptHeatColourChange1 component = flammable.GetComponent <FlammableScriptHeatColourChange1>();
         if (showDebug)
         {
             Debug.Log(base.name + " Doing Entry " + i);
         }
         if (component != null)
         {
             component.Extinguish();
         }
     }
 }
Exemple #6
0
    public void OnTriggerExit(Collider other)
    {
        if (showDebug)
        {
            Debug.Log(base.name + " Left Range " + other.name);
        }
        FlammableScriptHeatColourChange1 component = other.gameObject.GetComponent <FlammableScriptHeatColourChange1>();

        if (component != null)
        {
            if (showDebug)
            {
                Debug.Log(base.name + " The other thing here is a piece of coal ");
            }
            component.Extinguish();
        }
        Flammable component2 = other.gameObject.GetComponent <Flammable>();

        if ((bool)component2)
        {
            if (showDebug)
            {
                Debug.Log(base.name + " The other thing is flammable , its supposed to get hot ");
            }
            component2.heat = 0f;
        }
        Flame component3 = other.gameObject.GetComponent <Flame>();

        if ((bool)component3)
        {
            if (showDebug)
            {
                Debug.Log(base.name + " The other thing is flame , its supposed to get hot ");
            }
            component3.Extinguish();
        }
    }