public void Start() { globalController = GameObject.FindGameObjectWithTag(TagNames.GlobalController).GetComponent <GlobalController>(); if (globalController != null && color == NO_COLOR_DEFINED) { Color = futureColor != NO_COLOR_DEFINED ? futureColor : globalController.GetRandomColor(); } }
/// <summary> /// Update the small display of the next colors. /// </summary> public void ChangeNextPlayerColors() { BlockColor[] blockColors = nextPlayer.GetComponentsInChildren <BlockColor>(); foreach (BlockColor blockColor in blockColors) { blockColor.Color = globalController.GetRandomColor(); } }