예제 #1
0
    public void OnInventoryMoveServer(InventoryMove info)
    {
        //was it transferred from a player's visible inventory?
        if (info.FromPlayer != null && LightEmission != null)
        {
            LightEmission.RemoveLight(PlayerLightData);
            LightEmission = null;
        }

        if (info.ToPlayer != null)
        {
            if (CompatibleSlots.Contains(info.ToSlot.NamedSlot.GetValueOrDefault(NamedSlot.none)))
            {
                LightEmission = info.ToPlayer.GetComponent <LightEmissionPlayer>();
                LightEmission.AddLight(PlayerLightData);
            }
        }
    }