Ejemplo n.º 1
0
    public static GameObject CreateEntity(UnityEngine.Object entity, string selectStateID = "")
    {
        GameObject gameObject = null;

        if (entity is EditorMonster)
        {
            EditorMonster editorMonster = entity as EditorMonster;
            Debug.Log(editorMonster.name);
            gameObject = SceneUtils.CreateEntityInScene(string.Format("Assets/Resources/{0}.prefab", editorMonster.path), editorMonster.name);
            //SceneCache.AddToList<ScriptableObjectMonster>(ScriptableObjectMonster.Create(gameObject.transform, editorMonster.path, selectStateID, editorMonster.monsterId, editorMonster.name), DungeonCache.MonsterList);
        }
        gameObject.transform.SetParent(SceneCache.dungeonRoot);
        SceneCache.OnCacheChange();
        gameObject.layer = 9;
        return(gameObject);
    }