Ejemplo n.º 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);
 }
Ejemplo n.º 3
0
 public virtual void Save(GameDataWriter writer)
 {
     //Transform
     writer.Write(transform.localPosition);
     writer.Write(transform.localRotation);         //Thank You Polymorphism
     writer.Write(transform.localScale);
 }
Ejemplo n.º 4
0
 //PersistableObject
 public override void Save(GameDataWriter writer)
 {
     writer.Write(currentShipPrefab);
     writer.Write(coins);
     writer.Write(missilesCollapsed);
     writer.Write(topScore);
 }
 // 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);
 }
 public override void Save(GameDataWriter writer)
 {
     writer.Write(frequency);
     writer.Write(cosOffset);
     writer.Write(sinOffset);
     writer.Write(previousPosition);
 }
    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);
        }
    }
Ejemplo n.º 8
0
    public override void Save(GameDataWriter writer)
    {
        //AddTopScore(new Score(playerName, score));

        writer.Write(score);
        writer.Write(playerName);
    }
Ejemplo n.º 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);
 }
Ejemplo n.º 10
0
Archivo: Shape.cs Proyecto: yhrmh/test
 public override void Save(GameDataWriter writer)
 {
     base.Save(writer);
     writer.Write(color);
     writer.Write(AngularVelocity);
     writer.Write(Velocity);
 }
Ejemplo n.º 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);
 }
 public override void Save(GameDataWriter writer)
 {
     writer.Write(focalShape); //focal shape의 saveindex를 저장
     writer.Write(frequency);
     writer.Write(cosOffset);
     writer.Write(sinOffset);
     writer.Write(previousPosition);
 }
Ejemplo n.º 13
0
    public override void Save(GameDataWriter writer)
    {
        writer.Write(equippedWeaponIndex);

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

        writer.Write(ids);
    }
Ejemplo n.º 14
0
 public void SaveHighScores(GameDataWriter writer)
 {
     writer.Write(topScores.Count);
     foreach (var score in topScores)
     {
         writer.Write(score);
     }
 }
Ejemplo n.º 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);
 }
 public override void Save(GameDataWriter writer)
 {
     writer.Write(_focalShape);
     writer.Write(_frequency);
     writer.Write(_cosOffset);
     writer.Write(_sinOffset);
     writer.Write(_previousPosition);
 }
 //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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 19
0
 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);
     }
 }
Ejemplo n.º 20
0
 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]);
     }
 }
Ejemplo n.º 21
0
 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);
     }
 }
Ejemplo n.º 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);
        }
    }
Ejemplo n.º 23
0
    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]);
        }
    }
Ejemplo n.º 24
0
 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);
     }
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 26
0
 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);
     }
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 30
0
 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);
     }
 }