示例#1
0
    public void LoadData()
    {
        if (!_isStarted)
        {
            LoadImmediate();
            LoadData();
        }
        else
        {
            //Debug.Log("BeginLoad");

            sBuildingData data = sSaveSystem.LoadBuildingData();
            int[]         IDs  = data._IDs;
            for (int i = 0; i < data._IDs.Length; ++i)
            {
                int             id = IDs[i];
                BuildableObject b  = _hashTable[id];
                // Debug.Log("Loading for:" + b + " with hp=" + data._hp[i]);
                if (b)
                {
                    b.LoadData(data._IDs[i], data._Type[i], data._State[i], data._level[i], data._hp[i], data._hpMax[i]);
                }
                else
                {
                    Debug.LogError("ID:" + id + " was not present in the dictionary");
                };
            }
        }
    }