// Update is called once per frame void Update() { if (!rootObj) { rootObj = transform.root.gameObject; return; } switch (mSpriteSelType) { case SelectionType.eSelectionAim: { PlayerAimController playerAimControl = rootObj.GetComponent <PlayerAimController>(); if (playerAimControl) { currentDirection = playerAimControl.GetAimDirection(); } break; } case SelectionType.eSelectionMove: { PlayerMoveController playerMove = rootObj.GetComponent <PlayerMoveController>(); if (playerMove) { currentDirection = playerMove.GetAimDirection(); } break; } } if (m_directionalSprites.ContainsKey(currentDirection)) { SpriteRenderer spriteRender = GetComponent <SpriteRenderer>(); if (spriteRender) { SpriteSelection chosen = m_directionalSprites[currentDirection]; spriteRender.sprite = chosen.spriteSelection; } } if (bVerboseLogging) { Debug.Log("Current direction :" + currentDirection.ToString()); } }