public void InProcessTag(string tag, InkTalk talk, Story tempStory)
    {
        string op, data;

        StandardizationTag(tag, out op, out data);
        if (op == "addflag")
        {
            AddLocalFlag(data);
        }
        else if (op == "delfalg")
        {
            DelLocalFlag(data);
        }
        else if (op == "addflag_global")
        {
            FlagBag.Instance.AddFlag(data);
        }
        else if (op == "delflag_global")
        {
            FlagBag.Instance.DelFlag(data);
        }
        else if (op == "enable")
        {
            var obj = transform.Find(data);
            if (obj)
            {
                ProcessEnableDisableFlag(inkFile.name + "_enable:" + data);
                obj.gameObject.SetActive(true);
            }
        }
        else if (op == "disable")
        {
            var obj = transform.Find(data);
            if (obj)
            {
                ProcessEnableDisableFlag(inkFile.name + "_disable:" + data);
                obj.gameObject.SetActive(false);
            }
        }
        else if (op == "notfinished")
        {
            talk.notFinished = true;
        }
        else if (op == "endstory")
        {
            endStory = true;
        }
        else if (op == "upd_info")
        {
            PlayerInfo.UpdateFromInkStory(tempStory);
        }
        else if (op == "upd_description")
        {
            FlagBag.Instance.DelFlagsWithPrefix("description_" + inkFile.name + ":");
            description = data + "\n\n" + "<color=grey>" + description + "</color>";
            FlagBag.Instance.AddFlag("description_" + inkFile.name + ":" + description);
            MissionPanel.Instance.UpdateMissionDescription(nameForDisplay, description);
            MissionPreviewPanel.Instance.UpdateMission(nameForDisplay, description);
        }
        else if (op == "enableNPC")
        {
            ProcessEnableDisableFlag("enableNPC:" + data);
            NPCManager.Instance.RefreshEnable();
        }
        else if (op == "disableNPC")
        {
            ProcessEnableDisableFlag("disableNPC:" + data);
            NPCManager.Instance.RefreshEnable();
        }
        else if (op == "additem")
        {
            ItemPanel.Instance.AddItem(data);
            FlagBag.Instance.AddFlag("item_" + data);
        }
        else if (op == "delitem")
        {
            ItemPanel.Instance.RemoveItem(data);
            FlagBag.Instance.DelFlag("item_" + data);
        }
        else if (op == "addskin")
        {
            ItemPanel.Instance.AddSkin(data);
            FlagBag.Instance.AddFlag("skin_" + data);
        }
        else if (op == "addphoto")
        {
            ItemPanel.Instance.AddPhoto(data);
            FlagBag.Instance.AddFlag("photo_" + data);
        }
    }
Пример #2
0
    public void InProcessTag(string tag, InkTalk talk, Story tempStory)
    {
        string op, data;

        StandardizationTag(tag, out op, out data);

        if (op == "addflag")
        {
            AddLocalFlag(data);
        }
        else if (op == "delfalg")
        {
            DelLocalFlag(data);
        }
        else if (op == "addflag_global")
        {
            FlagBag.Instance.AddFlag(data);
        }
        else if (op == "delflag_global")
        {
            FlagBag.Instance.DelFlag(data);
        }
        else if (op == "enable")
        {
            var obj = transform.Find(data);
            if (obj)
            {
                ProcessEnableDisableFlag(inkFile.name + "_enable:" + data,
                                         inkFile.name + "_disable:" + data);
                obj.gameObject.SetActive(true);
            }
        }
        else if (op == "disable")
        {
            var obj = transform.Find(data);
            if (obj)
            {
                ProcessEnableDisableFlag(inkFile.name + "_disable:" + data,
                                         inkFile.name + "_enable:" + data);
                obj.gameObject.SetActive(false);
            }
        }
        else if (op == "notfinished")
        {
            talk.notFinished = true;
        }
        else if (op == "endstory")
        {
            EndStory();
        }
        else if (op == "upd_info")
        {
            PlayerInfo.UpdateFromInkStory(tempStory);
        }
        else if (op == "enableNPC")
        {
            ProcessEnableDisableFlag("enableNPC:" + data, "disableNPC:" + data);
            NPCManager.Instance.RefreshEnable();
        }
        else if (op == "disableNPC")
        {
            ProcessEnableDisableFlag("disableNPC:" + data, "enableNPC:" + data);
            NPCManager.Instance.RefreshEnable();
        }
    }