private void Start() { dropdown.gameObject.SetActive(false); if (block.GetType() == typeof(BlockDetectCollider)) { textBlock.text = "Detection de la Collision"; } else if (block.GetType() == typeof(BlockDetectColor)) { textBlock.text = "Detection de la Couleur"; } else { switch (block.type) { case BlockType.Bool: textBlock.text = block.GetBool() ? "True" : "False"; break; case BlockType.Color: textBlock.text = "Couleur"; dropdown.gameObject.SetActive(true); dropdown.ClearOptions(); List <string> colors = StatesColorExtends.ToList(); dropdown.AddOptions(colors); StatesColor.StatesColorType color = block.GetColor(); dropdown.SetValueWithoutNotify((int)color); break; } } }
private void Start() { colorDD.ClearOptions(); List <string> colors = StatesColorExtends.ToList(); colorDD.AddOptions(colors); colorDD.SetValueWithoutNotify((int)states.color); }