Example #1
0
        public void Init(byte[] buffer)
        {
            var helper = new BufferHelper(buffer);

            this.NatureTable = new NatureTable();
            NatureTable.Init(helper);

            this.ObsTable = new ObsTable();
            ObsTable.Init(helper);

            this.LevelTable = new LevelTable();
            LevelTable.Init(helper);
        }
Example #2
0
        public bool InitByBytes(byte[] bytes)
        {
            var helper = new BufferHelper(bytes);

            this.NatureTable = new NatureTable();
            NatureTable.Init(helper);

            this.ObsTable = new ObsTable();
            ObsTable.Init(helper);

            this.LevelTable = new LevelTable();
            LevelTable.Init(helper);

            return(true);
        }
Example #3
0
        public bool InitByResources(string filePath)
        {
            var txtAsset = Resources.Load <TextAsset>(filePath);

            if (txtAsset == null || txtAsset.bytes == null)
            {
                return(false);
            }

            var helper = new BufferHelper(txtAsset.bytes);

            this.NatureTable = new NatureTable();
            NatureTable.Init(helper);

            this.ObsTable = new ObsTable();
            ObsTable.Init(helper);

            this.LevelTable = new LevelTable();
            LevelTable.Init(helper);

            return(true);
        }
Example #4
0
        public IEnumerator Init(string filePath, Action onFinish = null)
        {
            var www = UnityEngine.Networking.UnityWebRequest.Get(filePath);

            yield return(www.SendWebRequest());

            var helper = new BufferHelper(www.downloadHandler.data);

            this.NatureTable = new NatureTable();
            NatureTable.Init(helper);

            this.ObsTable = new ObsTable();
            ObsTable.Init(helper);

            this.LevelTable = new LevelTable();
            LevelTable.Init(helper);

            if (onFinish != null)
            {
                onFinish();
            }
        }