-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockFormat.cs
More file actions
61 lines (52 loc) · 843 Bytes
/
BlockFormat.cs
File metadata and controls
61 lines (52 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
using UnityEngine;
using System.Collections;
namespace Uzu
{
public static class BlockFormat
{
public const uint CURRENT_VERSION = 0;
static public uint MagicNumber {
get { return
'B' << 24 |
'L' << 16 |
'C' << 8 |
'K';
}
}
static public string Extension {
get { return "blk"; }
}
public class Header
{
public uint version;
public VectorI3 count;
}
public class Data
{
public bool[] _states;
public RGB[] _colors;
}
public struct RGB
{
public byte r;
public byte g;
public byte b;
public RGB (Color32 color)
{
r = color.r;
g = color.g;
b = color.b;
}
public RGB (byte inR, byte inG, byte inB)
{
r = inR;
g = inG;
b = inB;
}
public Color32 ToColor32 ()
{
return new Color32 (r, g, b, 255);
}
}
}
}