Ejemplo n.º 1
0
    public void LoadFile(string path)
    {
        LoadCompleted = false;
#if UNITY_EDITOR || UNITY_IPHONE
        try
        {
            LoadCompleted = false;
            FileStr       = File.OpenRead(path);
            Buffer        = new byte[FileStr.Length];
            FileStr.BeginRead(Buffer, 0, (int)FileStr.Length, OnReadCallback, this);
        }
        catch
        {
        #if UNITY_EDITOR
            EditorApplication.isPlaying = false;
        #else
            Application.Quit();
        #endif
        }
#else
        CoroutineExecutor.ExecuteCoroutine(DoLoadFile(path));
#endif
    }