Exemple #1
0
        //セーブデータ用のバイナリ読み込み
        void ReadSaveData(BinaryReader reader)
        {
            int version = reader.ReadInt32();

            if (version <= VERSION_1)
            {
                ReadOldVersion(reader, version);
            }
            else if (version == VERSION)
            {
                this.isEventMode = reader.ReadBoolean();
                int count = reader.ReadInt32();
                for (int i = 0; i < count; i++)
                {
                    string           name            = reader.ReadString();
                    string           layerName       = reader.ReadString();
                    string           graphicDataType = reader.ReadString();
                    string           graphicKey      = reader.ReadString();
                    bool             isDefault       = reader.ReadBoolean();
                    GraphicInfoList  graphicInfo     = AdvGraphicInfoParser.FindGraphicInfo(engine, graphicDataType, graphicKey);
                    AdvGraphicLayer  layer           = FindLayer(layerName);
                    AdvGraphicObject graphic         = layer.AddObject(name, graphicInfo, isDefault);
                    graphic.Read(graphicInfo, reader);
                }
            }
            else
            {
                Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, version));
            }
        }
Exemple #2
0
        //古いセーブデータを読み込み
        internal void ReadOld(BinaryReader reader)
        {
            UtageToolKit.ReadLocalTransform(this.transform, reader);
            EffectColors.SetColor(Utage.EffectColors.Index.TweenColor, UtageToolKit.ReadColor(reader));

            //Tweenがある場合は、Tween情報を読み込む
            int tweenCount = reader.ReadInt32();

            for (int i = 0; i < tweenCount; ++i)
            {
                AdvTweenPlayer tween = this.gameObject.AddComponent <AdvTweenPlayer>();
                tween.Read(reader, PixelsToUnits);
            }

            GraphicInfoList graphic = AdvGraphicInfoParser.FindGraphicInfoFromTexturePath(Engine, reader.ReadString());

            OnDraw(graphic, 0);
            Graphic   = graphic;
            IsLoading = false;
        }