public override object Read(ES2Reader reader)
    {
        MiniGameSettingsSaves data = new MiniGameSettingsSaves();

        Read(reader, data);
        return(data);
    }
    public override void Write(object obj, ES2Writer writer)
    {
        MiniGameSettingsSaves data = (MiniGameSettingsSaves)obj;

        // Add your writer.Write calls here.
        writer.Write(0); // Version 1 is current version number
        // Make sure to edit Read() function to properly handle version control!
        // VERSION 0:
        writer.Write(data.angleSensorSensitivity);
        writer.Write(data.gravityStrength);
        writer.Write(data.groundBounce);
        writer.Write(data.groundFriction);
        writer.Write(data.groundPositionY);
        writer.Write(data.jointMotorForce);
        writer.Write(data.jointMotorSpeed);
        writer.Write(data.maxScoreDistance);
        writer.Write(data.maxTargetX);
        writer.Write(data.maxTargetY);
        writer.Write(data.maxTargetZ);
        writer.Write(data.minScoreDistance);
        writer.Write(data.minTargetX);
        writer.Write(data.minTargetY);
        writer.Write(data.minTargetZ);
        writer.Write(data.targetRadius);
        writer.Write(data.viscosityDrag);
        writer.Write(data.initForceMax);
        writer.Write(data.initForceMin);
        writer.Write(data.useRandomTargetPos);
        writer.Write(data.variableMass);
    }
    public override void Read(ES2Reader reader, object c)
    {
        MiniGameSettingsSaves data = (MiniGameSettingsSaves)c;
        // Add your reader.Read calls here to read the data into the object.
        // Read the version number.
        int fileVersion = reader.Read <int>();

        // VERSION 0:
        if (fileVersion >= 0)
        {
            data.angleSensorSensitivity = reader.Read <float>();
            data.gravityStrength        = reader.Read <float>();
            data.groundBounce           = reader.Read <float>();
            data.groundFriction         = reader.Read <float>();
            data.groundPositionY        = reader.Read <float>();
            data.jointMotorForce        = reader.Read <float>();
            data.jointMotorSpeed        = reader.Read <float>();
            data.maxScoreDistance       = reader.Read <float>();
            data.maxTargetX             = reader.Read <float>();
            data.maxTargetY             = reader.Read <float>();
            data.maxTargetZ             = reader.Read <float>();
            data.minScoreDistance       = reader.Read <float>();
            data.minTargetX             = reader.Read <float>();
            data.minTargetY             = reader.Read <float>();
            data.minTargetZ             = reader.Read <float>();
            data.targetRadius           = reader.Read <float>();
            data.viscosityDrag          = reader.Read <float>();
            data.initForceMax           = reader.Read <float>();
            data.initForceMin           = reader.Read <float>();
            data.useRandomTargetPos     = reader.Read <float>();
            data.variableMass           = reader.Read <float>();
            if (fileVersion >= 1)
            {
                // new attributes
            }
        }
    }
コード例 #4
0
 public override void CopySettingsFromLoad(MiniGameSettingsSaves miniGameSettingsSaves)
 {
     viscosityDrag[0]          = miniGameSettingsSaves.viscosityDrag;
     gravityStrength[0]        = miniGameSettingsSaves.gravityStrength;
     jointMotorForce[0]        = miniGameSettingsSaves.jointMotorForce;
     jointMotorSpeed[0]        = miniGameSettingsSaves.jointMotorSpeed;
     minTargetX[0]             = miniGameSettingsSaves.minTargetX;
     maxTargetX[0]             = miniGameSettingsSaves.maxTargetX;
     minTargetY[0]             = miniGameSettingsSaves.minTargetY;
     maxTargetY[0]             = miniGameSettingsSaves.maxTargetY;
     minTargetZ[0]             = miniGameSettingsSaves.minTargetZ;
     maxTargetZ[0]             = miniGameSettingsSaves.maxTargetZ;
     minScoreDistance[0]       = miniGameSettingsSaves.minScoreDistance;
     maxScoreDistance[0]       = miniGameSettingsSaves.maxScoreDistance;
     targetRadius[0]           = miniGameSettingsSaves.targetRadius;
     groundPositionY[0]        = miniGameSettingsSaves.groundPositionY;
     groundBounce[0]           = miniGameSettingsSaves.groundBounce;
     groundFriction[0]         = miniGameSettingsSaves.groundFriction;
     angleSensorSensitivity[0] = miniGameSettingsSaves.angleSensorSensitivity;
     initForceMin[0]           = miniGameSettingsSaves.initForceMin;
     initForceMax[0]           = miniGameSettingsSaves.initForceMax;
     useRandomTargetPos[0]     = miniGameSettingsSaves.useRandomTargetPos;
     variableMass[0]           = miniGameSettingsSaves.variableMass;
 }
コード例 #5
0
 public override void CopySettingsToSave(MiniGameSettingsSaves miniGameSettingsSaves)
 {
     miniGameSettingsSaves.angleSensorSensitivity = angleSensorSensitivity[0];
     miniGameSettingsSaves.gravityStrength        = gravityStrength[0];
     miniGameSettingsSaves.groundBounce           = groundBounce[0];
     miniGameSettingsSaves.groundFriction         = groundFriction[0];
     miniGameSettingsSaves.groundPositionY        = groundPositionY[0];
     miniGameSettingsSaves.jointMotorForce        = jointMotorForce[0];
     miniGameSettingsSaves.jointMotorSpeed        = jointMotorSpeed[0];
     miniGameSettingsSaves.maxScoreDistance       = maxScoreDistance[0];
     miniGameSettingsSaves.maxTargetX             = maxTargetX[0];
     miniGameSettingsSaves.maxTargetY             = maxTargetY[0];
     miniGameSettingsSaves.maxTargetZ             = maxTargetZ[0];
     miniGameSettingsSaves.minScoreDistance       = minScoreDistance[0];
     miniGameSettingsSaves.minTargetX             = minTargetX[0];
     miniGameSettingsSaves.minTargetY             = minTargetY[0];
     miniGameSettingsSaves.minTargetZ             = minTargetZ[0];
     miniGameSettingsSaves.targetRadius           = targetRadius[0];
     miniGameSettingsSaves.viscosityDrag          = viscosityDrag[0];
     miniGameSettingsSaves.initForceMin           = initForceMin[0];
     miniGameSettingsSaves.initForceMax           = initForceMax[0];
     miniGameSettingsSaves.useRandomTargetPos     = useRandomTargetPos[0];
     miniGameSettingsSaves.variableMass           = variableMass[0];
 }
	public override object Read(ES2Reader reader)
	{
		MiniGameSettingsSaves data = new MiniGameSettingsSaves();
		Read(reader, data);
		return data;
	}
コード例 #7
0
    public virtual void CopySettingsFromLoad(MiniGameSettingsSaves miniGameSettingsSaves) {

    }
コード例 #8
0
    public virtual void CopySettingsToSave(MiniGameSettingsSaves miniGameSettingsSaves) {

    }
コード例 #9
0
 public virtual void CopySettingsFromLoad(MiniGameSettingsSaves miniGameSettingsSaves)
 {
 }
コード例 #10
0
 public virtual void CopySettingsToSave(MiniGameSettingsSaves miniGameSettingsSaves)
 {
 }
 public override void CopySettingsToSave(MiniGameSettingsSaves miniGameSettingsSaves) {
     miniGameSettingsSaves.angleSensorSensitivity = angleSensorSensitivity[0];
     miniGameSettingsSaves.gravityStrength = gravityStrength[0];
     miniGameSettingsSaves.groundBounce = groundBounce[0];
     miniGameSettingsSaves.groundFriction = groundFriction[0];
     miniGameSettingsSaves.groundPositionY = groundPositionY[0];
     miniGameSettingsSaves.jointMotorForce = jointMotorForce[0];
     miniGameSettingsSaves.jointMotorSpeed = jointMotorSpeed[0];
     miniGameSettingsSaves.maxScoreDistance = maxScoreDistance[0];
     miniGameSettingsSaves.maxTargetX = maxTargetX[0];
     miniGameSettingsSaves.maxTargetY = maxTargetY[0];
     miniGameSettingsSaves.maxTargetZ = maxTargetZ[0];
     miniGameSettingsSaves.minScoreDistance = minScoreDistance[0];
     miniGameSettingsSaves.minTargetX = minTargetX[0];
     miniGameSettingsSaves.minTargetY = minTargetY[0];
     miniGameSettingsSaves.minTargetZ = minTargetZ[0];
     miniGameSettingsSaves.targetRadius = targetRadius[0];
     miniGameSettingsSaves.viscosityDrag = viscosityDrag[0];
     miniGameSettingsSaves.initForceMin = initForceMin[0];
     miniGameSettingsSaves.initForceMax = initForceMax[0];
     miniGameSettingsSaves.useRandomTargetPos = useRandomTargetPos[0];
     miniGameSettingsSaves.variableMass = variableMass[0];
 }
 public override void CopySettingsFromLoad(MiniGameSettingsSaves miniGameSettingsSaves) {
     viscosityDrag[0] = miniGameSettingsSaves.viscosityDrag;
     gravityStrength[0] = miniGameSettingsSaves.gravityStrength;
     jointMotorForce[0] = miniGameSettingsSaves.jointMotorForce;
     jointMotorSpeed[0] = miniGameSettingsSaves.jointMotorSpeed;
     minTargetX[0] = miniGameSettingsSaves.minTargetX;
     maxTargetX[0] = miniGameSettingsSaves.maxTargetX;
     minTargetY[0] = miniGameSettingsSaves.minTargetY;
     maxTargetY[0] = miniGameSettingsSaves.maxTargetY;
     minTargetZ[0] = miniGameSettingsSaves.minTargetZ;
     maxTargetZ[0] = miniGameSettingsSaves.maxTargetZ;
     minScoreDistance[0] = miniGameSettingsSaves.minScoreDistance;
     maxScoreDistance[0] = miniGameSettingsSaves.maxScoreDistance;
     targetRadius[0] = miniGameSettingsSaves.targetRadius;
     groundPositionY[0] = miniGameSettingsSaves.groundPositionY;
     groundBounce[0] = miniGameSettingsSaves.groundBounce;
     groundFriction[0] = miniGameSettingsSaves.groundFriction;
     angleSensorSensitivity[0] = miniGameSettingsSaves.angleSensorSensitivity;
     initForceMin[0] = miniGameSettingsSaves.initForceMin;
     initForceMax[0] = miniGameSettingsSaves.initForceMax;
     useRandomTargetPos[0] = miniGameSettingsSaves.useRandomTargetPos;
     variableMass[0] = miniGameSettingsSaves.variableMass;
 }