public void Start() { keyManager = GameHelpers.GetHUDKeyManager(); SpriteRenderer spriteRenderer = gameObject.GetComponent <SpriteRenderer>(); Color color = Color.GetColor(); spriteRenderer.color = color; }
public void Add(StandardColor color) { var key = playerState.Keys.FirstOrDefault(k => k.Color == StandardColor.None); if (key != null) { key.Color = color; key.Render.color = color.GetColor(); key.GameObject.SetActive(true); } }
// Use this for initialization public void Start() { keyManager = GameHelpers.GetHUDKeyManager(); levelSettings = GameHelpers.GetLevelSettings(); scoreObject = gameObject.GetComponent <ScoreObject>(); if (KeyColor != StandardColor.None) { gameObject.GetComponent <SpriteRenderer>().color = KeyColor.GetColor(); } //if (KeyColor != StandardColor.None) //{ // var keyObject = gameObject.transform.Find(StaticNames.DoorKey).gameObject; // SpriteRenderer spriteRenderer = keyObject.GetComponent<SpriteRenderer>(); // Color color = KeyColor.GetColor(); // spriteRenderer.color = color; //} }