コード例 #1
0
 public virtual void Save(GameDataWriter writer)
 {
     // Write the position, rotation and scale to file
     writer.Write(transform.localPosition);
     writer.Write(transform.localRotation);
     writer.Write(transform.localScale);
 }
 /// <summary>
 /// 存储当前物体
 /// </summary>
 public virtual void Save(GameDataWriter writer)
 {
     // 存储当前物体位置、旋转和缩放
     writer.Write(transform.localPosition);
     writer.Write(transform.localRotation);
     writer.Write(transform.localScale);
 }
コード例 #3
0
 public virtual void Save(GameDataWriter writer)
 {
     //Transform
     writer.Write(transform.localPosition);
     writer.Write(transform.localRotation);         //Thank You Polymorphism
     writer.Write(transform.localScale);
 }
コード例 #4
0
 //PersistableObject
 public override void Save(GameDataWriter writer)
 {
     writer.Write(currentShipPrefab);
     writer.Write(coins);
     writer.Write(missilesCollapsed);
     writer.Write(topScore);
 }
コード例 #5
0
 // Virtual so it can be overridden
 // Writes data into writer from transform
 public virtual void Save(GameDataWriter writer)
 {
     writer.Write(transform.localPosition);
     writer.Write(transform.localRotation);
     writer.Write(transform.localScale);
     writer.Write(meshRenderer.material.color);
 }
コード例 #6
0
 public override void Save(GameDataWriter writer)
 {
     writer.Write(frequency);
     writer.Write(cosOffset);
     writer.Write(sinOffset);
     writer.Write(previousPosition);
 }
コード例 #7
0
    void Save()
    {
        var cubeBinaryWriter   = new BinaryWriter(File.Open(saveCubeDataPath, FileMode.Create));
        var spherBinaryeWriter = new BinaryWriter(File.Open(saveSphereDataPath, FileMode.Create));

        GameDataWriter cubeDataWriter   = new GameDataWriter(cubeBinaryWriter);
        GameDataWriter sphereDataWriter = new GameDataWriter(spherBinaryeWriter);

        cubeDataWriter.Write(iterableCubeObject.Length);
        for (int i = 0; i < iterableCubeObject.Length; i++)
        {
            cubeDataWriter.Write(iterableCubeObject[i].transform.localPosition);
            cubeDataWriter.Write(iterableCubeObject[i].transform.localRotation);
            cubeDataWriter.Write(iterableCubeObject[i].transform.localScale);
        }


        sphereDataWriter.Write(iterableSphereObject.Length);
        for (int i = 0; i < iterableSphereObject.Length; i++)
        {
            sphereDataWriter.Write(iterableSphereObject[i].transform.localPosition);
            sphereDataWriter.Write(iterableSphereObject[i].transform.localRotation);
            sphereDataWriter.Write(iterableSphereObject[i].transform.localScale);
        }
    }
コード例 #8
0
    public override void Save(GameDataWriter writer)
    {
        //AddTopScore(new Score(playerName, score));

        writer.Write(score);
        writer.Write(playerName);
    }
コード例 #9
0
 public void Save(GameDataWriter writer)
 {
     writer.Write(State.number);
     writer.Write(State.isChecked ? 1 : 0);
     writer.Write(State.coordinates.x);
     writer.Write(State.coordinates.y);
 }
コード例 #10
0
ファイル: Shape.cs プロジェクト: yhrmh/test
 public override void Save(GameDataWriter writer)
 {
     base.Save(writer);
     writer.Write(color);
     writer.Write(AngularVelocity);
     writer.Write(Velocity);
 }
コード例 #11
0
 public virtual void Save(GameDataWriter writer)
 {
     writer.Write(this.cloudid);
     writer.Write(this.type);
     writer.Write(this.localPosition);
     writer.Write(this.localRotation);
     writer.Write(this.localScale);
 }
コード例 #12
0
 public override void Save(GameDataWriter writer)
 {
     writer.Write(focalShape); //focal shape의 saveindex를 저장
     writer.Write(frequency);
     writer.Write(cosOffset);
     writer.Write(sinOffset);
     writer.Write(previousPosition);
 }
コード例 #13
0
    public override void Save(GameDataWriter writer)
    {
        writer.Write(equippedWeaponIndex);

        string ids = String.Join(",", characterItems.ToArray());

        writer.Write(ids);
    }
コード例 #14
0
 public void SaveHighScores(GameDataWriter writer)
 {
     writer.Write(topScores.Count);
     foreach (var score in topScores)
     {
         writer.Write(score);
     }
 }
コード例 #15
0
 public override void Save(GameDataWriter writer)
 {
     writer.Write(focalShape); //write focalShape's index in Game's shapes List
     writer.Write(frequency);
     writer.Write(cosOffset);
     writer.Write(sinOffset);
     writer.Write(previousPosition);
 }
コード例 #16
0
 public override void Save(GameDataWriter writer)
 {
     writer.Write(_focalShape);
     writer.Write(_frequency);
     writer.Write(_cosOffset);
     writer.Write(_sinOffset);
     writer.Write(_previousPosition);
 }
コード例 #17
0
 //Method used to save objects
 public virtual void Save(GameDataWriter writer)
 {
     //Write the localpositon as Vector 3
     writer.Write(transform.localPosition);
     //Write the localrotation as Quarternion
     writer.Write(transform.localRotation);
     //Write the localscale as Vector3
     writer.Write(transform.localScale);
 }
コード例 #18
0
 public override void Save(GameDataWriter writer)
 {
     base.Save(writer);
     writer.Write(stats.CurrentHealth);
     writer.Write(currentAmmo);
     writer.Write(lastAttack);
     writer.Write(movePoint);
     writer.Write(gameObject.activeSelf);
 }
コード例 #19
0
ファイル: Game.cs プロジェクト: iamkrut/UnityProjects
 public override void Save(GameDataWriter writer)
 {
     writer.Write(shapes.Count);
     for (int i = 0; i < shapes.Count; i++)
     {
         writer.Write(shapes[i].ShapeId);
         writer.Write(shapes[i].MaterialId);
         shapes[i].Save(writer);
     }
 }
コード例 #20
0
ファイル: CoreDataProvider.cs プロジェクト: svnvav/UberSpace
 public void Save(GameDataWriter writer)
 {
     writer.Write(_lastLoadedLevel);
     writer.Write(_lastLoadedLevelStage);
     writer.Write(_cometsCount);
     for (int i = 0; i < _cometsCount; i++)
     {
         writer.Write(_cometCatchFlags[i]);
     }
 }
コード例 #21
0
ファイル: Game.cs プロジェクト: EngineVulkan/UnityLesson
 public override void Save(GameDataWriter writer)
 {
     writer.Write(shapes.Count);
     writer.Write(loadingLevelBuildIndex);
     for (int i = 0; i < shapes.Count; i++)
     {
         writer.Write(shapes[i].ShapeId);
         shapes[i].Save(writer);
     }
 }
コード例 #22
0
    public override void Save(GameDataWriter writer)
    {
        writer.Write(-saveVersion);
        writer.Write(m_Objects.Count);

        for (int i = 0; i < m_Objects.Count; i++)
        {
            m_Objects[i].Save(writer);
        }
    }
コード例 #23
0
ファイル: Cell.cs プロジェクト: Valefors/PlanetEditor
    public override void Save(GameDataWriter writer)
    {
        writer.Write(type);
        writer.Write(_propsList.Count);

        for (int i = 0; i < _propsList.Count; i++)
        {
            writer.Write(_propsList[i]);
        }
    }
コード例 #24
0
ファイル: Game.cs プロジェクト: wjezxujian/CatlikeCoding
 public override void Save(GameDataWriter writer)
 {
     //writer.Write(-saveVersion);
     writer.Write(shapes.Count);
     for (int i = 0; i < shapes.Count; ++i)
     {
         writer.Write(shapes[i].ShapeId);
         writer.Write(shapes[i].MaterialId);
         shapes[i].Save(writer);
     }
 }
コード例 #25
0
 public override void Save(GameDataWriter writer)
 {
     //writer.Write(-saveVersion); //now in persistentStorage.Save() //write version negative, so it can be checked against older versions that didnt have a version
     writer.Write(shapes.Count);
     for (int i = 0; i < shapes.Count; i++)
     {
         writer.Write(shapes[i].ShapeId);
         writer.Write(shapes[i].MaterialId);
         shapes[i].Save(writer);
     }
 }
コード例 #26
0
ファイル: Game.cs プロジェクト: r000setta/UnityPractice
 public override void Save(GameDataWriter writer)
 {
     writer.Write(shapes.Count);
     writer.Write(loadLevelBuildIdx);
     for (int i = 0; i < shapes.Count; ++i)
     {
         writer.Write(shapes[i].ShapeId);
         writer.Write(shapes[i].MaterialId);
         shapes[i].Save(writer);
     }
 }
コード例 #27
0
        public void Save(GameDataWriter writer)
        {
            writer.Write(_currentStarsCount);
            _scenario.Save(writer);

            writer.Write(_levelObjects.Length);
            foreach (var levelObject in _levelObjects)
            {
                levelObject.Save(writer);
            }
        }
コード例 #28
0
 public override void Save(GameDataWriter writer)
 {
     base.Save(writer);
     writer.Write(colors.Length);
     for (int i = 0; i < colors.Length; i++)
     {
         writer.Write(colors[i]);
     }
     writer.Write(AngularVelocity);
     writer.Write(Velocity);
 }
コード例 #29
0
 public override void Save(GameDataWriter writer)
 {
     writer.Write(_shapes.Count);
     writer.Write(_loadedLevelIndex);
     for (int i = 0; i < _shapes.Count; i++)
     {
         writer.Write(_shapes[i].ShapeId);
         writer.Write(_shapes[i].MaterialId);
         _shapes[i].Save(writer);
     }
 }
コード例 #30
0
ファイル: Game_2.cs プロジェクト: scheninsp/testUnity
 public override void Save(GameDataWriter writer)
 {
     writer.Write(saveVersion);
     writer.Write(shapes.Count);
     for (int i = 0; i < shapes.Count; i++)
     {
         //Debug.Log("writing : " + shapes[i].ShapeId);
         writer.Write(shapes[i].ShapeId);
         writer.Write(shapes[i].MaterialId);
         shapes[i].Save(writer);
     }
 }