Пример #1
0
        /// <summary>
        /// セーブデータ用のバイナリ読みこみ
        /// </summary>
        /// <param name="reader">バイナリリーダー</param>
        public void ReadSaveData(BinaryReader reader)
        {
            UtageToolKit.ReadLocalTransform(this.transform, reader);
            this.LocalColor = UtageToolKit.ReadColor(reader);
            //Tweenがある場合は、Tween情報を読み込む
            int tweenCount = reader.ReadInt32();

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

            //各スプライトの読み込み
            int count = reader.ReadInt32();

            for (int i = 0; i < count; ++i)
            {
                string         name   = reader.ReadString();
                AdvFadeSprites sprite = GetSpriteCreateIfMissing(name);
                sprite.Read(reader);
            }
            string defaultSpriteName = reader.ReadString();

            if (!string.IsNullOrEmpty(defaultSpriteName))
            {
                DefaultSprite = FindSprite(defaultSpriteName);
            }
        }
Пример #2
0
        /// <summary>
        /// セーブデータ用のバイナリ読みこみ
        /// </summary>
        /// <param name="reader">バイナリリーダー</param>
        public void Read(BinaryReader reader)
        {
            UtageToolKit.ReadLocalTransform(this.transform, reader);
            this.LocalColor = UtageToolKit.ReadColor(reader);

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

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

            string    nameCurrenTexture = reader.ReadString();
            AssetFile texture           = AssetFileManager.Load(nameCurrenTexture, this);

            currentSprite = CreateSprite(texture);
            texture.Unuse(this);
        }