인벤토리 기능 추가
This commit is contained in:
@@ -16,7 +16,16 @@ public class ResourceManager
|
||||
return null;
|
||||
}
|
||||
|
||||
return Object.Instantiate(prefab, parent);
|
||||
GameObject go = Object.Instantiate(prefab, parent);
|
||||
int index = go.name.IndexOf("(Clone)");
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
// go.name = go.name.Substring(0, index);
|
||||
go.name = go.name.Remove(index);
|
||||
}
|
||||
|
||||
return go;
|
||||
}
|
||||
|
||||
public void Destroy(GameObject go)
|
||||
|
||||
@@ -39,6 +39,23 @@ public class UIManager
|
||||
canvas.sortingOrder = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public T MakeSubItem<T>(Transform parent = null, string name = null) where T : UI_Base
|
||||
{
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
name = typeof(T).Name;
|
||||
}
|
||||
|
||||
GameObject go = Managers.Resource.Instantiate($"UI/SubItem/{name}");
|
||||
|
||||
if (parent != null)
|
||||
{
|
||||
go.transform.SetParent(parent);
|
||||
}
|
||||
|
||||
return go.GetOrAddComponent<T>();
|
||||
}
|
||||
|
||||
public T ShowSceneUI<T>(string name = null) where T : UI_Scene
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user