Flamable.DetermineIgniteOrExtinguish C# (CSharp) Method

DetermineIgniteOrExtinguish() public method

public DetermineIgniteOrExtinguish ( GameObject col ) : void
col GameObject
return void
    void DetermineIgniteOrExtinguish(GameObject col)
    {
        if(col.GetComponent<Substance>() != null && col.GetComponent<Substance>().isWater())
        {
            if(Extinguished != null)
                Extinguished(this.gameObject);

            Extinguish();
        }
        if(col.GetComponent("Flamable") == null)
        {
            return;
        }

        Flamable other_flamable = col.GetComponent("Flamable") as Flamable;

        if(other_flamable.isIgnited())
            Ignite();
    }