예제 #1
0
        public EntityInfoPanel setEntityInfo(string title, string info)
        {
            AIEntity ai = null;

            foreach (AIEntity a in AIEntity.FindObjectsOfType(typeof(AIEntity)))
            {
                if (a.IsSelected() && !a.m_IsControllable)
                {
                    ai = a;
                }
                if (ai == null && a.IsAddedToWorld && !a.m_IsControllable)
                {
                    ai = a;
                }
            }
            ai.m_Selectable.SetSelected(false);
            ai.CurrentlySelected();
            ai.m_Selectable.SetSelected(true);

            EntityInfoPanel ui = (EntityInfoPanel)EntityInfoPanel.FindObjectOfType(typeof(EntityInfoPanel));

            ui.m_DetailText.Text        = info; // + "(GUI m_DetailText)";
            ui.m_DetailText.m_Text.text = info; // + "(GUI m_Text)";
            ui.name = title;                    // + "(GUI name)";
            ui.m_SummaryText.text = title;      // + "(GUI m_SummaryText)";
                                                //ui.m_BuyButton.enabled = true;
            if (!ui.IsVisible())
            {
                ui.Show();
            }

            return(ui);
        }
예제 #2
0
    public EntityInfoPanel setEntityInfo(string title, string info)
    {
        //UIEntityInterface uiei = ((UIEntityInterface)UIEntityInterface.FindObjectOfType(typeof(UIEntityInterface)));
        //uiei.m_selected = true;
        //uiei.m_AttachTracker = true;
        //uiei.m_ShowAgentUI = true;
        //uiei.m_SelectedText = info;
        //uiei.TargetVisible = true;
        //uiei.enabled = true;
        //uiei.SetSelected(true);

        AIEntity ai = null;

        foreach (AIEntity a in AIEntity.FindObjectsOfType(typeof(AIEntity)))
        {
            if (a.IsSelected() && !a.m_IsControllable)
            {
                ai = a;
            }
            if (ai == null && a.IsAddedToWorld && !a.m_IsControllable)
            {
                ai = a;
            }
        }
        ai.m_Selectable.SetSelected(false);
        ai.CurrentlySelected();
        //ai.SetSelected(true);
        ai.m_Selectable.SetSelected(true);

        EntityInfoPanel ui = (EntityInfoPanel)EntityInfoPanel.FindObjectOfType(typeof(EntityInfoPanel));

        //ui.SetAiEntity(ai);
        ui.m_DetailText.Text        = info; // + "(GUI m_DetailText)";
        ui.m_DetailText.m_Text.text = info; // + "(GUI m_Text)";
        ui.name = title;                    // + "(GUI name)";
        ui.m_SummaryText.text = title;      // + "(GUI m_SummaryText)";
        //ui.m_BuyButton.enabled = true;
        if (!ui.IsVisible())
        {
            ui.Show();
        }
        //AIEntityInfoUi aiui = (AIEntityInfoUi)AIEntityInfoUi.FindObjectOfType(typeof(AIEntityInfoUi));

        //ui.m_SummaryText.color = Color.red;

        //ai.m_Selectable.SetSelected(false);
        //ai.SetSelected(false);

        return(ui);
    }