private void Start() { if (hidden) { transform.Translate(0, hiddenYDifference, 0); } if (rotatingPillar != null) { rotatingPillar.enabled = false; } rotatingPillar = GetComponent <RotatingPillar>(); }
/** * Identify where the children of the group should be in relation to the centre based on the radius and put them there. */ public void InitialiseAndPositionGroup(float radius) { Debug.Log("Group Children: " + transform.childCount); groupCentre = GetComponent <RotatingPillar>(); for (int childIndex = 0; childIndex < transform.childCount; childIndex++) { //Get the RotatingPillar component from the child, skip it if it doesn't have one. GroupRotatingPillar pillar = transform.GetChild(childIndex).GetComponent <GroupRotatingPillar>(); if (pillar == null) { continue; } outerPillarsCorrectPosition.Add(pillar, pillar.transform.localPosition); pillar.transform.localPosition = GetChildPosition(pillar, radius); } }
/** * Returns an array of all the pillars in the manager. */ protected RotatingPillar[] GetPillars() { RotatingPillar[] result = new RotatingPillar[rotatingPillars.Count]; rotatingPillars.CopyTo(result); return(result); }
/** * Add a pillar to be checked as part of the solution. */ public void Subscribe(RotatingPillar pillar) { rotatingPillars.Add(pillar); }