Пример #1
0
    void OnMonsterSelectCallBack(object userData)
    {
        int[] tempData = (int[])userData;
        if (tempData[0] == 0)
        {
            Debug.LogError("怪物ID为0");
            return;
        }
        MonsterEditObj tempObj;

        if (MapEditModel.Instance.curMapVo.monsterEditDic.TryGetValue(tempData[0], out tempObj))
        {
            tempObj.monsterId = tempData[1];
            GameObject tempGo;
            if (monsterGoDic.TryGetValue(tempData[0], out tempGo))
            {
                DeleteAllChild(tempGo);
                GameObject tempModel = GameObject.Instantiate(UnityEditor.AssetDatabase.LoadAssetAtPath <Object>(tableModel.GetInfoById(tableMonsterDic[tempObj.monsterId].model).path)) as GameObject;
                tempModel.transform.SetParent(tempGo.transform, false);
                tempGo.name = MONSTER_PREFIX + tempObj.guid + "|" + tempObj.monsterId;
            }
            this.Repaint();
        }
    }