public static bool Create(SoundsPlayer soundsPlayer, int rootId, out SoundsPlayerSerialized result, bool saveClipToFile = false) { result = new SoundsPlayerSerialized { rootId = rootId }; for (var i = 0; i < 4; i++) { result.selectFrom.Add(soundsPlayer.Configs[i].SelectFrom); result.selectTo.Add(soundsPlayer.Configs[i].SelectTo); result.rate.Add(soundsPlayer.Configs[i].Rate); result.volume.Add(soundsPlayer.Configs[i].Volume); } return(true); }
public static GameSerialized Create() { var result = new GameSerialized { NodeBlocks = new List <NodeBlockSerialized>(), RootBlocks = new List <RootBlockSerialized>(), Binds = new List <BindSerialized>(), SoundsPlayers = new List <SoundsPlayerSerialized>(), }; foreach (var block in FieldMatrix.GetAllAsList()) { switch (block) { case NodeBlock nodeBlock: { if (NodeBlockSerialized.Create(nodeBlock, out var t)) { result.NodeBlocks.Add(t); } break; } case RootBlock rootBlock: { if (RootBlockSerialized.Create(rootBlock, out var t)) { result.RootBlocks.Add(t); } break; } } } foreach (var bind in BindMatrix.GetAllAsList()) { if (BindSerialized.Create(bind, out var t)) { result.Binds.Add(t); } } foreach (var root in Roots.Root.Values) { if (SoundsPlayerSerialized.Create(root.block.soundsPlayer, root.block.rootId, out var t)) { result.SoundsPlayers.Add(t); } } return(result); }