forked from Majiir/MuMechLib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Part.cs
37 lines (33 loc) · 909 Bytes
/
Part.cs
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
using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
public class MuMechPart : Part
{
private static int s_creationOrder = 0;
public int creationOrder = 0;
public static void traceTrans(string prev, Transform tr)
{
print(prev + "." + tr.name);
for (int i = 0; i < tr.childCount; i++)
{
traceTrans(prev + "." + tr.name, tr.GetChild(i));
}
}
public bool isSymmMaster()
{
for (int i = 0; i < symmetryCounterparts.Count; i++)
{
if (symmetryCounterparts[i].GetComponent<MuMechPart>().creationOrder < creationOrder)
{
return false;
}
}
return true;
}
protected override void onPartStart()
{
base.onPartStart();
creationOrder = s_creationOrder++;
}
}