コード例 #1
0
ファイル: GUIHandeler.cs プロジェクト: EivindLervik/TheColony
    void Start () {
        // Set private
        toolTip = toolTipGO.GetComponent<ToolTipScript>();
        infoDisplay = infoDisplayGO.GetComponent<UnitInformation>();

        currentBuilding = 0;
        isInBuildMode = false;
        useToolTip = true;
        DeActivateToolTip();
        ChangePointer("Normal");
        HideUnitInformation();
        buildMenu.SetActive(false);
    }
コード例 #2
0
    public static void AddTip(string message)
    {
        GameObject help_tip_panel = menus.menu_panels["HelpTip"];

        Debug.Log("ToolTipScript message " + message);
        ToolTipScript tool_script = (ToolTipScript)help_tip_panel.GetComponent(typeof(ToolTipScript));

        help_tip_panel.SetActive(false);
        StringReader reader  = new StringReader(message);
        XmlDocument  xml_doc = new XmlDocument();

        xml_doc.Load(reader);
        XmlNode tip_node = xml_doc.SelectSingleNode("//tool_tip");

        tool_script.tool_tip.text = tip_node["text"].InnerText;
        help_tip_panel.SetActive(true);
        Canvas.ForceUpdateCanvases();
    }
コード例 #3
0
    // Update is called once per frame
    void Update()
    {
        float delta = Time.deltaTime;

        elapsed_since_receive += delta;
        if (elapsed_since_receive > 0.1f)
        {
            elapsed_since_receive = 0.0f;
        }
        else
        {
            return;
        }
        //Debug.Log("call receive");
        int len = ReceiveMsg();

        while (len > 0)
        {
            if (!server_ready)
            {
                if (read_string == "ready")
                {
                    Debug.Log("IPCManager got server ready");
                    server_ready = true;
                    GameLoadBehavior.AfterServerReady();
                    SendRequest("begin");
                    SendRequest("on_screen:" + menus.UI_SCREEN_OFFICE);
                }
                return;
            }
            string command = read_string;
            string message = null;
            //Debug.Log("buf [" + read_string + "]");
            if (read_string.IndexOf(':') > 0)
            {
                message = ccUtils.GetCommand(read_string, out command);
            }

            //Debug.Log("IPC update got command " + command + " message [" + message+"]");
            switch (command)
            {
            case "status":
                //Debug.Log("got status %s" + message);
                GameStatusScript.UpdateStatus(message);
                break;

            case "attack_log":
                //Debug.Log("got status %s" + message);
                AttackLogScript.AddEntry(message);
                break;

            case "load_computer":
                ComputerBehavior.LoadOneComputer(message + ".sdf");
                break;

            case "load_device":
                DeviceBehavior.LoadOneDevice(message + ".sdf");
                break;

            case "user_status":
                UserBehavior.UpdateStatus(message);
                break;

            case "ticker":
                scrolling_text.AddTicker(message);
                break;

            case "withdraw_ticker":
                scrolling_text.WithdrawTicker(message);
                break;

            case "message":
                MessageScript message_panel = (MessageScript)menus.menu_panels["MessagePanel"].GetComponent(typeof(MessageScript));
                message_panel.ShowMessage(message);
                break;

            case "yes_no":
                YesNoScript yesno_panel = (YesNoScript)menus.menu_panels["YesNoPanel"].GetComponent(typeof(YesNoScript));
                yesno_panel.ShowMessage(message);
                break;

            case "tool_tip":
                ToolTipScript.AddTip(message);
                break;

            case "objective":
                ObjectivesBehavior.ObjectiveStatus(message);
                break;

            case "phase":
                ObjectivesBehavior.PhaseDone(message);
                break;

            case "lose":
                SendRequest("exit");
                QuitGame();
                break;

            case "remove_computer":
                ComputerBehavior.RemoveComputer(message);
                break;

            default:
                Debug.Log("nothing to do for " + command + " " + message);
                break;
            }
            len = ReceiveMsg();
        }
    }
コード例 #4
0
 void Awake() //Sets the instance to the object its attached too. There can only be one of this type of instance.
 {
     instance = this;
 }
コード例 #5
0
ファイル: Shop.cs プロジェクト: ErteTD/Depper
 void Start()
 {
     tts     = FindObjectOfType <ToolTipScript>();
     Player_ = GameObject.Find("Player");
     GM      = GameManager.FindObjectOfType <GameManager>();
 }
コード例 #6
0
 // Use this for initialization
 void Start()
 {
     toolTipScript = GetComponent <ToolTipScript>();
 }