public override void Load(GameDataReader reader)
 {
     focalShape       = reader.ReadShapeInstance();
     frequency        = reader.ReadFloat();
     cosOffset        = reader.ReadVector3();
     sinOffset        = reader.ReadVector3();
     previousPosition = reader.ReadVector3();
 }
        private IEnumerator LoadGame(GameDataReader reader)
        {
            int version = reader.Version;

            int count = version <= 0 ? -version : reader.ReadInt();

            if (version >= 3)
            {
                Random.State state = reader.ReadRandomState();
                if (!reseedOnLoad)
                {
                    Random.state = state;
                }
                CreationSpeed       = creationSpeedSlider.value = reader.ReadFloat();
                creationProgress    = reader.ReadFloat();
                DestructionSpeed    = destructionSpeedSlider.value = reader.ReadFloat();
                destructionProgress = reader.ReadFloat();
            }

            yield return(LoadLevel(version < 2 ? 1 : reader.ReadInt()));

            if (version >= 3)
            {
                GameLevel.Current.Load(reader);
            }

            for (int i = 0; i < count; i++)
            {
                int   factoryId  = version >= 5 ? reader.ReadInt() : 0;
                int   shapeId    = version > 0 ? reader.ReadInt() : 0;
                int   materialId = version > 0 ? reader.ReadInt() : 0;
                Shape instance   = shapeFactories[factoryId].Get(shapeId, materialId);
                instance.Load(reader);
            }

            for (int i = 0; i < shapes.Count; i++)
            {
                shapes[i].ResolveShapeInstances();
            }
        }
        IEnumerator LoadGame(GameDataReader reader)
        {
            int version = reader.Version;
            int count   = version > 0 ? reader.ReadInt() : -version;

            if (version >= 3)
            {
                Random.State state = reader.ReadRandomState();
                if (resetOnLoad)
                {
                    Random.state = state;
                }
                creationSpeedSlider.value    = CreationSpeed = reader.ReadFloat();
                creationProgress             = reader.ReadFloat();
                destructionSpeedSlider.value = DestructionSpeed = reader.ReadFloat();
                destructionProgress          = reader.ReadFloat();
            }
            yield return(LoadLevel(version < 2 ? 1 : reader.ReadInt()));

            if (version >= 3)
            {
                GameLevel.Current.Load(reader);
            }
            var tran = transform;

            for (int i = 0; i < count; i++)
            {
                int   factoryId = version >= 5 ? reader.ReadInt() : 0;
                int   shapeId   = version > 0 ? reader.ReadInt() : 0;
                int   matId     = version > 0 ? reader.ReadInt() : 0;
                Shape o         = shapeFactorys[factoryId].Get(shapeId, matId);
                o.transform.parent = tran;
                o.Load(reader);
                shapes.Add(o);
            }
        }
Beispiel #4
0
 public override void Load(GameDataReader reader)
 {
     originalScale = reader.ReadVector3();
     duration      = reader.ReadFloat();
 }
Beispiel #5
0
 public override void Load(GameDataReader reader)
 {
     spawnProgress = reader.ReadFloat();
 }
 public override void Load(GameDataReader reader)
 {
     Offset              = reader.ReadVector3();
     Frequency           = reader.ReadFloat();
     previousOscillation = reader.ReadFloat();
 }