public static void DownloadAssetByWWW()
    {
        //loadasset("http://localhost/HotfixAsset/cube.txt");
        EmptyMono mono = GameObject.FindObjectOfType <EmptyMono>();

        if (!mono)
        {
            GameObject obj = new GameObject("Mono");
            mono = obj.AddComponent <EmptyMono>();
        }
        //"http://localhost/HotfixAsset/Version.txt"
        mono.StartCoroutine(ParseVersion("Version.txt"));
    }
Exemple #2
0
        private UnityEngine.Material LoadMaterial(Material suncgMat)
        {
            UnityEngine.Material mat = new UnityEngine.Material(Shader.Find("Standard"));
            mat.name = suncgMat.name;
            Color c = Color.white;

            ColorUtility.TryParseHtmlString(suncgMat.diffuse, out c);
            mat.color = c;
            if (suncgMat.texture != null)
            {
                coRunner.StartCoroutine(LoadSunCGTextureIntoMaterial(suncgMat.texture, mat));
            }
            return(mat);
        }