Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Project hangs on Splash Screen on Master Build / Metro x86 but not Debug /x86

Discussion in 'Windows' started by Cherubim79, Feb 14, 2015.

  1. Cherubim79

    Cherubim79

    Joined:
    May 3, 2014
    Posts:
    55
    Simple project, just a Canvas/EventSystem, a few buttons, a few texts, and a couple of scripts that work fine in the editor.

    This loads an XML resource in my Assets/Resources/XML/CognitiveFunctions. Works fine in the editor and on Debug but freezes on the Splash Screen on Master build for Windows Store 8.1 on Unity 4.6.2 new project. Not sure why, seems so basic it should work???

    Also, tried removing the script and the freeze still occurred, but worked prior to trying to load an XML resource.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4. using UnityEngine.UI;
    5.  
    6. public class FunctionDescriptions : MonoBehaviour {
    7.  
    8.     Dictionary<string,string> CognitiveFunctions;
    9.     public Text FunctionNameText;
    10.     public Text FunctionDescriptionText;
    11.     public FunctionButton[] Buttons;
    12.  
    13.     // Use this for initialization
    14.     void Start () {
    15.         CognitiveFunctions = new Dictionary<string, string> ();
    16.         System.Xml.XmlDocument doc = new System.Xml.XmlDocument ();
    17.         TextAsset xmlAsset = Resources.Load<TextAsset>("XML/CognitiveFunctions");
    18.         doc.LoadXml (xmlAsset.text);
    19.         foreach (System.Xml.XmlNode childNode in doc["functions"].ChildNodes) {
    20.             CognitiveFunctions.Add(childNode["name"].InnerText, childNode["description"].InnerText);
    21.         }
    22.         foreach (FunctionButton button in Buttons) {
    23.             //Debug.Log("Adding " + button.FunctionName);
    24.             string testHolder = button.FunctionName;
    25.             button.Button.onClick.AddListener(() => {
    26.                 SetText(testHolder);
    27.             });
    28.         }
    29.     }
    30.  
    31.     void SetText(string functionName) {
    32.         //Debug.Log ("Set Text called " + functionName);
    33.         this.FunctionNameText.text = functionName;
    34.         this.FunctionDescriptionText.text = this.CognitiveFunctions [functionName];
    35.     }
    36.  
    37.     // Update is called once per frame
    38.     void Update () {
    39.  
    40.     }
    41. }
    42.  
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    2,289
    Did you try to debug it with Visual Studio, like breaking during freeze? Also what UnityPlayer.log says.

    Cheers
     
unityunity