Ejemplo n.º 1
0
 private void Start()
 {
     GearEditor.InitGears();
     gears      = GearEditor.self.gears;
     chosenGear = GearEditor.self.gears[0];
     SetupGearRotation();
 }
Ejemplo n.º 2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        GearEditor myScript = (GearEditor)target;

        if (!myScript.update)
        {
            if (GUILayout.Button("Connect"))
            {
                myScript.ConnectAllGears();
            }
        }
    }
Ejemplo n.º 3
0
    private void Start()
    {
        GearEditor.InitGears();
        gears = GearEditor.self.gears;

        gears.ForEach(gear => gear.childs = new List <Gear>());
        foreach (Gear gear in gears)
        {
            if (gear.parent != null)
            {
                gear.parent.childs.Add(gear);
            }
        }

        chosenGear.gear.right = inverseRotation;
        childs = new List <Gear>();

        foreach (Gear gear in chosenGear.gear.childs)
        {
            gear.right = !chosenGear.gear.right;
            childs.Add(gear);
        }

        while (childs.Count > 0)
        {
            child = childs[0];
            childs.RemoveAt(0);

            foreach (Gear gear in child.childs)
            {
                gear.right = !child.right;
                childs.Add(gear);
            }
        }

        SetupGearRotation();
    }
Ejemplo n.º 4
0
 private void Awake()
 {
     self = this;
 }