Exemplo n.º 1
0
 private void Start()
 {
     GearEditor.InitGears();
     gears      = GearEditor.self.gears;
     chosenGear = GearEditor.self.gears[0];
     SetupGearRotation();
 }
Exemplo n.º 2
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();
    }