コード例 #1
0
    public bool OnMouseDown(string id, string desc, string examine, string use)
    {
        if (isTextPanelOpen())
        {
            return(false);
        }
        flowChart.ExecuteBlock("PlaySound");
        string text = "";

        if (tool.Equals("eye"))
        {
            text = examine;
        }
        else if (tool.Equals("hand"))
        {
            text = use;
        }
        else if (tool.Equals("combine"))
        {
            if (isCombining)
            {
                if (!combinations.CanCombine(obj1_id, id))
                {
                    text = "I can't seem to use the " + obj1_desc + " with the " + desc + ".";
                }
                else
                {
                    text = combinations.CombineObjects(obj1_id, id);
                }
                isCombining = false;
                combineText = "";
                obj1_id     = "";
                obj1_desc   = "";
            }
            else
            {
                isCombining = true;
                combineText = actionText.text;
                obj1_id     = id;
                obj1_desc   = desc;
                return(false);
            }
        }
        UpdateActionText("");
        if (canEnd())   // To trigger on end condition
        {
            endButton.gameObject.SetActive(true);
        }
        flowChart.SetStringVariable("msg", text);
        flowChart.ExecuteBlock("DialogBox");
        return(true);
    }