Example #1
0
    public void SetFlameState(FlameState state)
    {
        if (state == flameState)
        {
            return;
        }
        switch (state)
        {
        case FlameState.NONE:
            ResetFire();
            break;

        case FlameState.HEATING:
            SetHeating();
            break;

        case FlameState.BURNED_OUT:
            SetBurnedOut();
            break;

        case FlameState.BURNING:
            SetBurning();
            fireSim.AddFire(this);
            break;

        case FlameState.COOLING:
            SetCooling();
            break;

        default:
            break;
        }
        if (flameState == FlameState.BURNING && state != FlameState.BURNING)
        {
            fireSim.RemoveFire(this);
        }
        flameState = state;
    }
Example #2
0
 public void Delete()
 {
     fireSim.RemoveFire(this);
     Destroy(gameObject);
 }