Example #1
0
	void Start(){
		S = this; 
		GameObject tAnc = new GameObject("TileAnchor");
		tileAnchor = tAnc.transform;
		roomsXMLR = new PT_XMLReader(); 
		roomsXMLR.Parse(roomsText.text); 
		roomsXML = roomsXMLR.xml["xml"][0]["room"]; 
		BuildRoom(roomNumber);
	}//end of Start()
Example #2
0
	void Awake() {
		S = this; // Set the Singleton for LayoutTiles
		// Make a new GameObject to be the TileAnchor (the parent transform of
		// all Tiles). This keeps Tiles tidy in the Hierarchy pane.
		GameObject tAnc = new GameObject("TileAnchor");
		tileAnchor = tAnc.transform;
		// Read the XML
		roomsXMLR = new PT_XMLReader(); // Create a PT_XMLReader
		roomsXMLR.Parse(roomsText.text); // Parse the Rooms.xml file
		roomsXML = roomsXMLR.xml["xml"][0]["room"]; // Pull all the <room>s
		// Build the 0th Room
		BuildRoom(roomNumber);
	}
Example #3
0
    void Awake()
    {
        S = this;         // Set the Singleton for LayoutTiles
        // Make a new GameObject to be the TileAnchor (the parent transform of
        //  all Tiles). This keeps Tiles tidy in the Hierarchy pane.
        GameObject tAnc = new GameObject("TileAnchor");

        tileAnchor = tAnc.transform;
        // Read the XML
        roomsXMLR = new PT_XMLReader();             // Create a PT_XMLReader
        roomsXMLR.Parse(roomsText.text);            // Parse the Rooms.xml file
        roomsXML = roomsXMLR.xml["xml"][0]["room"]; // Pull all the <room>s
        // Build the 0th Room
        BuildRoom(roomNumber);
    }
Example #4
0
    void Awake()
    {
        S = this;   // Задаём синглтон

        // Создаём новый ио чтобы быть якорем для всех плит
        // сохранит нашу иерархию чистой
        GameObject tAnc = new GameObject("TileAnchor");

        tileAnchor = tAnc.transform;

        // Читаем XML
        roomsXMLR = new PT_XMLReader();             // Создаём считыватель
        roomsXMLR.Parse(roomsText.text);            // Передаём Rooms.xml
        roomsXML = roomsXMLR.xml["xml"][0]["room"]; // Достаём все комнаты
    }
Example #5
0
    void Start()
    {
        S = this;         //Singleton for LayoutTiles

        //Make a new GameObject to be the TileAnchor (the parent transform of all Tiles). To keep Tiles tidy in the hierarchy pane
        GameObject tAnc = new GameObject("TileAnchor");

        tileAnchor = tAnc.transform;

        //Read the XML
        roomsXMLR = new PT_XMLReader();             //Create a PT_XMLReader, which is lighter-weight that what's on .NET
        roomsXMLR.Parse(roomsText.text);            //Parse the Rooms.xml file
        roomsXML = roomsXMLR.xml["xml"][0]["room"]; //Pull all the <room>s

        //Build the 0th room
        BuildRoom(roomNumber);
    }
Example #6
0
    //Methods

    void Start()
    {
        S = this;

        //Make tile anchor
        GameObject tAnc = new GameObject("TileAnchor");

        tileAnchor = tAnc.transform;

        //Read room xml
        roomsXMLR = new PT_XMLReader();
        roomsXMLR.Parse(roomsText.text);
        roomsXML = roomsXMLR.xml ["xml"] [0] ["room"];

        //Build 0th room
        BuildRoom(roomNumber);
    }
    private void Start()
    {
        S = this;
        //Make a new GameObject to be the TileAnchor (the parent transform of all tiles).
        //This keeps Tiles tidy in the Hierarchy pane;
        GameObject tAnc = new GameObject("TileAnchor");

        tileAnchor = tAnc.transform;

        //Read the XML
        roomsXMLR = new PT_XMLReader();
        roomsXMLR.Parse(roomsText.text);
        roomsXML = roomsXMLR.xml["xml"][0]["room"]; // Get all the <rooms>s

        //Build the 0 room
        BuildRoom(roomNumber);
    }
Example #8
0
    private void Awake()
    {
        instance = this;

        // Make a group for all tiles
        GameObject anchor = new GameObject("tileAnchor");

        tileAnchor = anchor.transform;

        // Read the JSON file
        RoomsFile customRooms = null;

        if (!string.IsNullOrEmpty(loadPath))
        {
            try
            {
                customRooms = JsonConvert.DeserializeObject <RoomsFile>(File.ReadAllText(loadPath));
            }
            catch (System.Exception e)
            {
                Debug.LogError("Could not load custom rooms file due to a " + e.GetType().Name);
                Debug.LogError(e.StackTrace);
            }
        }
        if (customRooms == null)
        {
            if (loadOriginal)
            {
                roomsData = JsonConvert.DeserializeObject <RoomsFile>(originalRoomsFile.text);
            }
            else
            {
                roomsData = JsonConvert.DeserializeObject <RoomsFile>(roomsFile.text);
            }
        }
        else
        {
            roomsData = customRooms;
        }

        roomId = roomsData.startingRoom;
    }
Example #9
0
    private void Awake()
    {
        //为LayoutTiles设置Singleton值
        S = this;

        //创建一个新的GameObject为TileAnchor
        GameObject tAnc = new GameObject("TileAnchor");

        tileAnchor = tAnc.transform;

        //读取XML
        //创建一个PT_XMLReader对象
        roomsXMLR = new PT_XMLReader();
        //解析Rooms.xml文件
        roomsXMLR.Parse(roomsText.text);
        //导出所有<room>
        roomsXML = roomsXMLR.xml["xml"][0]["room"];

        //建立第0个room
        BuildRoom(roomNumber);
    }
 void Start()
 {
     S = this; // Set the Singleton for LayoutTiles
     // Make a new GameObject to be the TileAnchor (the parent transform of
     // all Tiles). This keeps Tiles tidy in the Hierarchy pane.
     GameObject tAnc = new GameObject("TileAnchor");
     tileAnchor = tAnc.transform;
     Utils.tr("..........",tileAnchor);
     // Read the XML
     levelsXMLR = new PT_XMLReader(); // Create a PT_XMLReader
     levelsXMLR.Parse(levelText.text); // Parse the Rooms.xml file
     levelsXML = levelsXMLR.xml["xml"][0]["level"]; // Pull all the <room>s
     BuildLevel (ApplicationModel.XMLlevel);
 }