static void OnPowerupCollect(Powerup powerup) { var colorizer = powerup.GetComponent <Colorizer>(); if (colorizer != null) { PowerupColorDisplay.AddColor(colorizer.Color); } }
private void Update() { if (Input.GetKeyDown(KeyCode.Space)) { if (collector.CollectorEnabled) { if (collector.HeldPowerups.Count > 0) { PowerupColorDisplay.Clear(); } collector.Execute(); } else { singleCollector.Execute(); } } if (Input.GetKeyDown(KeyCode.Escape)) { Application.Quit(); } }
private void Awake() { rectT = GetComponent <RectTransform>(); Instance = this; }