Exemplo n.º 1
0
    /// <summary>
    /// If selected item is obstacleConstructor or Checkpoint, show the contextual UI
    /// </summary>
    public void ShowUISelectedItem()
    {
        if (null == m_selectedItem || GameManager.Instance.GetEndGameBool())
        {
            return;
        }

        if (m_selectedItem.GetComponent <ObstacleConstructor> () && m_selectedItem.GetComponent <ObstacleConstructor> ().GetCurrentState() == ObstacleConstructor.EState.Buildable)
        {
            m_selectedItem.GetComponent <ObstacleConstructor> ().GetUISpawnObstacle().SetActive(true);
        }
        else if (m_selectedItem.GetComponent <CheckpointCollider> ())
        {
            m_selectedItem.transform.parent.GetComponent <CheckpointBase> ().GetUIReleaseUnit().ShowUIRelease();
        }
    }