public void Initialize(SingleBlockInfo info, BlockPosition position, byte rotation) { ConnectSides = Blocks.Rotation.RotateSides(info.ConnectSides, rotation); Position = position; Type = info.Type; Rotation = rotation; }
/// <summary> /// Creates a "placed" block. /// </summary> public static PlacedSingleBlock MakeSinglePlaced(Transform parent, SingleBlockInfo info, byte rotation, BlockPosition position) { GameObject block = InstantiatePrefab(parent, info, rotation, position); PlacedSingleBlock component = block.AddComponent <PlacedSingleBlock>(); component.Initialize(info, position, rotation); return(component); }
private static void AddSingle(BlockType type, uint health, uint mass, BlockSides connectSides) { Blocks[(ushort)type] = new SingleBlockInfo(type, health, mass, Resources.Load("Blocks/" + type) as GameObject, connectSides); }