add project files
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class PickupSkinProvider : MonoBehaviour
|
||||
{
|
||||
private PickupsSkinDef _skin;
|
||||
|
||||
public event Action onSkinChanged;
|
||||
|
||||
public void SetSkin(PickupsSkinDef newSkin)
|
||||
{
|
||||
PickupsSkinDef previous = _skin;
|
||||
_skin = newSkin;
|
||||
if (newSkin != previous && this.onSkinChanged != null)
|
||||
{
|
||||
this.onSkinChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public GameObject GetSkin(TypeItem type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TypeItem.Rich:
|
||||
return _skin.prefabGood;
|
||||
case TypeItem.Poor:
|
||||
return _skin.prefabBad;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user