// Start is called before the first frame update void Start() { cube = transform.GetChild(0); // season = GetComponent<Season>(); cycle = GetComponent <WeightedCycle>(); startingPosition = cube.transform.position; }
private void InitSiblings() { int siblingCount = transform.parent.childCount; priorNode = transform.parent.GetChild((transform.GetSiblingIndex() + siblingCount - 1) % siblingCount).GetComponent <WeightedCycle>(); nextNode = transform.parent.GetChild((transform.GetSiblingIndex() + 1) % siblingCount).GetComponent <WeightedCycle>(); // it would be great to not do this priorKey = priorNode.key < key ? priorNode.key : priorNode.key - 1; nextKey = nextNode.key > key ? nextNode.key : nextNode.key + 1; }