示例#1
0
//#endif


    public void loadSnapshot(FakePlayerSaver saver)
    {
//#if UNITY_EDITOR
        if (saver.towers.Count == 0)
        {
            return;
        }
        Init();
        current_snapshot  = saver.current_snapshot;
        snapshot_filename = saver.snapshot_filename;
        ff = saver.ff;
        force_all_towers   = saver.force_all_towers;
        force_all_upgrades = saver.force_all_upgrades;

        upgrades = CloneUtil.copyList <TowerUpgrade>(saver.upgrades);
        for (int i = 0; i < towers.Count; i++)
        {
            towers[i].loadSnapshot(saver.towers[i]);
        }

        foreach (Firearm f in Peripheral.Instance.firearms)
        {
            if (f.toy.toy_type == ToyType.Temporary)
            {
                ghosts.Add(f.toy);
            }
        }

//#endif
    }
示例#2
0
    public FakePlayerSaver getSnapshot()
    {
        FakePlayerSaver saver = new FakePlayerSaver();

//#if UNITY_EDITOR
        saver.current_snapshot  = current_snapshot;
        saver.snapshot_filename = snapshot_filename;
        saver.ff                 = ff;
        saver.upgrades           = CloneUtil.copyList <TowerUpgrade>(upgrades);
        saver.force_all_upgrades = force_all_upgrades;
        saver.force_all_towers   = force_all_towers;

        List <BuildTowerSaver> towers_saver = new List <BuildTowerSaver>();

        for (int i = 0; i < towers.Count; i++)
        {
            towers_saver.Add(towers[i].getSnapshot());
        }
        saver.towers = towers_saver;

//#endif
        return(saver);
    }