예제 #1
0
    private void EnsureInit()
    {
        if (registerTile != null)
        {
            return;
        }
        if (SMALL_BURNING_PREFAB == null)
        {
            SMALL_BURNING_PREFAB = CommonPrefabs.Instance.BurningSmall;
            LARGE_BURNING_PREFAB = CommonPrefabs.Instance.BurningLarge;
        }

        if (SMALL_ASH == null)
        {
            SMALL_ASH = TileManager.GetTile(TileType.Effects, "SmallAsh") as OverlayTile;
            LARGE_ASH = TileManager.GetTile(TileType.Effects, "LargeAsh") as OverlayTile;
        }
        registerTile = GetComponent <RegisterTile>();
        pushable     = GetComponent <IPushable>();
        //this is just a guess - large items can't be picked up
        isLarge = GetComponent <Pickupable>() == null;
        if (Resistances.Flammable)
        {
            if (burningObjectOverlay == false)
            {
                burningObjectOverlay = GameObject.Instantiate(isLarge ? LARGE_BURNING_PREFAB : SMALL_BURNING_PREFAB, transform)
                                       .GetComponent <BurningOverlay>();
            }

            burningObjectOverlay.enabled = true;
            burningObjectOverlay.StopBurning();
        }
    }
예제 #2
0
    private void EnsureInit()
    {
        if (registerTile != null)
        {
            return;
        }
        if (SMALL_BURNING_PREFAB == null)
        {
            SMALL_BURNING_PREFAB = Resources.Load <GameObject>("SmallBurning");
            LARGE_BURNING_PREFAB = Resources.Load <GameObject>("LargeBurning");
        }
        registerTile = GetComponent <RegisterTile>();
        pushable     = GetComponent <IPushable>();
        //this is just a guess - large items can't be picked up
        isLarge = GetComponent <Pickupable>() == null;
        if (Resistances.Flammable)
        {
            if (burningObjectOverlay == false)
            {
                burningObjectOverlay = GameObject.Instantiate(isLarge ? LARGE_BURNING_PREFAB : SMALL_BURNING_PREFAB, transform)
                                       .GetComponent <BurningOverlay>();
            }

            burningObjectOverlay.enabled = true;
            burningObjectOverlay.StopBurning();
        }
    }