- Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathFixedArray.cs
More file actions
Latest commit
53 lines (41 loc) · 841 Bytes
/
Copy pathFixedArray.cs
File metadata and controls
53 lines (41 loc) · 841 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
usingSystem.Collections;
usingSystem.Collections.Generic;
usingUnityEngine;
/*
public class Vector2x4 : FixedArray<Vector2,of4>
{
};
*/
publicinterfaceSizePolicy
{
intSize{get;}
}
publicclassof4:SizePolicy
{
publicintSize{get{return4;}}
}
// gr: cannot serialise a template!
[System.Serializable]
publicclassFixedArray<Type,SizePolicyType>whereSizePolicyType:SizePolicy,new()
{
publicTypethis[intIndex]{
get{
returnElements[Index];
}
set{
Elements[Index]=value;
}
}
publicintLength{get{returnSize.Size;}}
publicintCount{get{returnSize.Size;}}
SizePolicyTypeSize=newSizePolicyType();
//[System.Serializable]
Type[]_Elements;
Type[]Elements{
get{
if(_Elements==null)
_Elements=newType[Length];
return_Elements;
}
}
};