Beispiel #1
0
    private void onLoadMap()
    {
        foreach (Vector3 list in mapObject.Keys)
        {
            Destroy(mapObject[list]);
            //mapObject.Remove(list);
            mapIndexObject.Remove(list);
        }
        mapObject = null;
        mapObject = new Dictionary <Vector3, GameObject>();

        XMLTest xml = new XMLTest();

        //gameObject.SetActive(false);
        mapIndexObject = xml.LoadXml();


        foreach (Vector3 list in mapIndexObject.Keys)
        {
            GameObject obj = GameObject.Instantiate(mapItemList[mapIndexObject[list]], list, gameObject.transform.rotation);
            mapObject[obj.transform.position] = obj;
            obj.transform.SetParent(map.transform);
        }
        creatPanel.SetActive(false);
    }
Beispiel #2
0
    private void gamestrat()
    {
        //gameObject.SetActive(false);
        curPassInfo = xml.loadPassInfo();

        string fullPath = Application.dataPath + "/Resources/map/Prefabs" + "/";

        DirectoryInfo direction = new DirectoryInfo(fullPath);

        FileInfo[] files = direction.GetFiles("*", SearchOption.AllDirectories);

        gameObject.GetComponent <MapManager>().initmap(xml.LoadXml());

        gameObject.GetComponent <MonsterManager>().initMonsterPatrol(patrolObject);
        ;
        gameObject.GetComponent <PassMananger>().initBox(xml.LoadBoxXml());
        gameObject.GetComponent <PassMananger>().initPassInfo(curPassInfo);
        gameObject.GetComponent <TrapManager>().inittrap(curPassInfo.trapList);
    }