Example #1
0
    // Use this for initialization
    protected void Start()
    {
        library   = GameObject.FindObjectOfType <Library>();
        taskValue = library.taskStrings.GetTaskValue(this.GetType().Name);

        item = library.pauseMenu.AddTask(this);

        item.SetDescription(GetDescription());
        item.SetReward(reward + "");

        if (PreferencesSaver.TaskIsComplete(1, this.GetType().Name))
        {
            SetComplete();
            item.SetDone();
        }
    }
Example #2
0
File: Task.cs Project: taboo1/arena
    // Use this for initialization
    protected void Start()
    {
        library = GameObject.FindObjectOfType<Library>();
        taskValue = library.taskStrings.GetTaskValue(this.GetType().Name);

        item = library.pauseMenu.AddTask(this);

        item.SetDescription(GetDescription());
        item.SetReward(reward + "");

        if (PreferencesSaver.TaskIsComplete(1, this.GetType().Name))
        {
            SetComplete();
            item.SetDone();
        }
    }
Example #3
0
    // Use this for initialization
    void Awake()
    {
        TextAsset xmlAsset = Resources.Load("Info/TaskStrings") as TextAsset;

        XmlDocument xmlDoc = new XmlDocument();

        if (xmlAsset)
        {
            xmlDoc.LoadXml(xmlAsset.text);
        }



        foreach (XmlNode node in xmlDoc.ChildNodes[0])
        {
            if (node.Name.Equals("ru"))
            {
                foreach (XmlNode childVal in node.ChildNodes)
                {
                    List <string> fullText   = new List <string>();
                    List <string> helperText = new List <string>();

                    foreach (XmlNode point in childVal.ChildNodes)
                    {
                        switch (point.Attributes["type"].Value)
                        {
                        case "fulltext": fullText.Add(point.InnerText); break;

                        case "helpertext": helperText.Add(point.InnerText); break;
                        }
                    }
                    TaskValue taskValue = new TaskValue(fullText.ToArray(), helperText.ToArray());
                    try
                    {
                        obj.Add(childVal.Attributes["name"].Value, taskValue);
                    }
                    catch
                    {
                        continue;
                    }
                }
            }
        }
    }
Example #4
0
    // Use this for initialization
    void Awake()
    {
        TextAsset xmlAsset = Resources.Load("Info/TaskStrings") as TextAsset;

        XmlDocument xmlDoc = new XmlDocument();
        if (xmlAsset)
            xmlDoc.LoadXml(xmlAsset.text);

        foreach (XmlNode node in xmlDoc.ChildNodes[0])
        {
            if (node.Name.Equals("ru"))
            {
                foreach (XmlNode childVal in node.ChildNodes)
                {
                    List<string> fullText = new List<string>();
                    List<string> helperText = new List<string>();

                    foreach(XmlNode point in childVal.ChildNodes)
                    {
                        switch(point.Attributes["type"].Value)
                        {
                            case "fulltext": fullText.Add(point.InnerText); break;
                            case "helpertext": helperText.Add(point.InnerText); break;
                        }
                    }
                    TaskValue taskValue = new TaskValue(fullText.ToArray(),helperText.ToArray());
                    try
                    {
                        obj.Add(childVal.Attributes["name"].Value, taskValue);
                    }
                    catch
                    {
                        continue;
                    }
                }
            }

        }
    }