Ejemplo n.º 1
0
 public void Recycle()
 {
     questAgents.Clear();
     questGroup    = null;
     nameText.text = string.Empty;
     ObjectPool.Put(gameObject);
 }
Ejemplo n.º 2
0
    private void OnEnable()
    {
        group = target as QuestGroup;

        _ID   = serializedObject.FindProperty("_ID");
        _name = serializedObject.FindProperty("_name");
    }
Ejemplo n.º 3
0
 public bool Add(QuestGroup questGroup)
 {
     try
     {
         questGroup.qg_datecreate = DateTime.Now;
         questGroup.qg_status     = false;
         return(true);
     }
     catch (Exception) { return(false); }
 }
Ejemplo n.º 4
0
 public void initMissionCard(Quest _quest)
 {
     quest = _quest;
     //
     _questGroup            = quest.Group;
     MissionNameText.text   = quest.TITLE;
     MissionDetailText.text = quest.DESC;
     //
     refreshMisionState();
 }
Ejemplo n.º 5
0
    private bool ExistsID()
    {
        QuestGroup[] groups = Resources.LoadAll <QuestGroup>("Configuration");

        QuestGroup find = Array.Find(groups, x => x.ID == _ID.stringValue);

        if (!find)
        {
            return(false);      //若没有找到,则ID可用
        }
        //找到的对象不是原对象 或者 找到的对象虽是原对象但同ID超过一个 时为true
        return(find != group || (find == group && Array.FindAll(groups, x => x.ID == _ID.stringValue).Length > 1));
    }
Ejemplo n.º 6
0
    private void ReadQuestGroupsFromNode(XmlNode node)
    {
        if (node == null)
        {
            return;
        }
        foreach (XmlNode childNode in node.ChildNodes)
        {
            if (childNode.LocalName != "questgroup")
            {
                continue;
            }
            QuestGroup newQuestGroup = new QuestGroup();
            newQuestGroup.id = uint.Parse(childNode.Attributes[IDATTR_NAME].Value);

            ReadLangStringFromNode(childNode, new LangStringPair(newQuestGroup.name, NAMENODE_NAME));

            questGroups.Add(newQuestGroup.id, newQuestGroup);
        }
    }
Ejemplo n.º 7
0
 public QuestAgentData(QuestGroup group, IEnumerable <QuestData> quests)
 {
     this.group  = group;
     this.quests = new List <QuestData>(quests);
 }
Ejemplo n.º 8
0
        public TableFile(string inFilename, byte[] rawData, byte[] inHeader, int[] ptrs, int baseAddr)
        {
            header   = inHeader;
            filename = inFilename;  //Assuming they'll always base 0.
            MemoryStream transFile  = new MemoryStream(rawData);
            BinaryReader fileReader = new BinaryReader(transFile);

            transFile.Seek(8, SeekOrigin.Begin);
            int headerLoc = fileReader.ReadInt32();

            transFile.Seek(headerLoc, SeekOrigin.Begin);
            unkShort1 = fileReader.ReadInt16();
            unkShort2 = fileReader.ReadInt16();
            timestamp = fileReader.ReadInt32();
            int categoryAddr  = fileReader.ReadInt32();
            int questListAddr = fileReader.ReadInt32();
            int catCount      = fileReader.ReadInt16();
            int questCount    = fileReader.ReadInt16();

            nameIndex = fileReader.ReadInt16();
            descIndex = fileReader.ReadInt16();
            startX    = fileReader.ReadInt16();
            startY    = fileReader.ReadInt16();
            enableCustomBackground = fileReader.ReadInt16();
            backgroundNumber       = fileReader.ReadInt16();
            defaultIcon            = fileReader.ReadInt16();
            returnToCityIndex      = fileReader.ReadInt16();
            int returnAddr = fileReader.ReadInt32();

            if (returnAddr != 0)
            {
                transFile.Seek(returnAddr - baseAddr, SeekOrigin.Begin);
                cityReturnQuest = fileReader.ReadInt32();
                cityReturnZone  = fileReader.ReadInt16();
                cityReturnMap   = fileReader.ReadInt16();
                cityReturnEntry = fileReader.ReadInt32();
            }

            int[] questList = new int[questCount];
            transFile.Seek(questListAddr - baseAddr, SeekOrigin.Begin);
            for (int i = 0; i < questCount; i++)
            {
                questList[i] = fileReader.ReadInt32();
            }

            transFile.Seek(categoryAddr - baseAddr, SeekOrigin.Begin);
            for (int i = 0; i < catCount; i++)
            {
                QuestGroup grp = new QuestGroup();
                grp.questNums = new List <int>();
                short firstQuest            = fileReader.ReadInt16();
                short currentListQuestCount = fileReader.ReadInt16();
                for (int k = 0; k < currentListQuestCount; k++)
                {
                    grp.questNums.Add(questList[k + firstQuest]);
                }
                grp.nameIndex = fileReader.ReadInt16();
                grp.descIndex = fileReader.ReadInt16();
                grp.unkShort1 = fileReader.ReadInt16();
                grp.unkShort2 = fileReader.ReadInt16();
                grp.unkBytes  = fileReader.ReadBytes(0x14);
                categories.Add(grp);
            }
        }