コード例 #1
0
    static void LoadEnemy()
    {
        FileInfo fi = new FileInfo(xmlPath);

        if (fi.Exists)
        {
            string [] name = fi.Name.Split('.');
            string [] nums = name [0].Split('_');
            fileNum = nums[1];
            StreamReader sr      = fi.OpenText();
            string       content = sr.ReadToEnd();
            sr.Close();
            if (content.ToString() != "")
            {
                mTerrain = (MazeTerrain)DeserializeEnemyObject(content);
            }
        }
    }
コード例 #2
0
    static void CreateCubeXml(MazeTerrain smaze)
    {
        string       data = SerializeCubeObject(smaze);
        StreamWriter writer;

        fileName = "Element_";
        if (maze.MazeID == "")
        {
            maze.MazeID = fileNum;
        }

        string   savePath = string.Format("{0}/../../../Config/Tables/Maze/{1}{2}.xml", Application.dataPath, fileName, maze.MazeID);
        FileInfo file     = new FileInfo(savePath);

        writer = file.CreateText();
        writer.Write(data);
        writer.Close();
    }
コード例 #3
0
 static void Init()
 {
     maze             = new Maze();
     mTerrain         = new MazeTerrain();
     mTerrain.cubes_  = new ArrayList();
     mTerrain.lights_ = new ArrayList();
     //lightobjs_ = new List<GameObject> ();
     //Cubeobjs_ = new List<GameObject> ();
     maze.zoneList   = new ArrayList();
     isCreate        = false;
     isbegin         = true;
     isXMLInfoEditor = false;
     root            = GameObject.Find("MazeRoot");
     if (root == null)
     {
         root = new GameObject("MazeRoot");
     }
 }