コード例 #1
0
  /*  void sceneChanged(Notification notification)
    {
        npcs = GameObject.FindGameObjectsWithTag("TalkingNpc");
        npcs = null;
    }*/

    void playerWannaTalk(Notification notification)
    {
        if (npc != null)
        {
            string text;

            script = npc.gameObject.GetComponent("NpcController") as NpcController;
            text = script.getText();
            if (text != "")
            {
                Variables.text=text;
                NotificationCenter.DefaultCenter().PostNotification(this, "drawText");
            } else
            {
                NotificationCenter.DefaultCenter().PostNotification(this, "hideText");
            }
        }
    }
コード例 #2
0
    /*  void sceneChanged(Notification notification)
     * {
     *    npcs = GameObject.FindGameObjectsWithTag("TalkingNpc");
     *    npcs = null;
     * }*/

    void playerWannaTalk(Notification notification)
    {
        if (npc != null)
        {
            string text;

            script = npc.gameObject.GetComponent("NpcController") as NpcController;
            text   = script.getText();
            if (text != "")
            {
                Variables.text = text;
                NotificationCenter.DefaultCenter().PostNotification(this, "drawText");
            }
            else
            {
                NotificationCenter.DefaultCenter().PostNotification(this, "hideText");
            }
        }
    }