コード例 #1
0
		IEnumerator Start()
		{
			var loader = new GLTFLoader(
				Url,
				gameObject.transform
			);
			loader.SetShaderForMaterialType(GLTFLoader.MaterialType.PbrMetallicRoughness, GLTFStandard);
			loader.SetShaderForMaterialType(GLTFLoader.MaterialType.CommonConstant, GLTFConstant);
			loader.Multithreaded = Multithreaded;
			loader.MaximumLod = MaximumLod;
			yield return loader.Load();
		}
コード例 #2
0
        IEnumerator Start()
        {
            UnityWebRequest www = UnityWebRequest.Get(Url);

            yield return(www.SendWebRequest());

            byte[] gltfData = www.downloadHandler.data;

            var loader = new GLTFLoader(
                gltfData,
                gameObject.transform
                );

            loader.SetShaderForMaterialType(GLTFLoader.MaterialType.PbrMetallicRoughness, GLTFStandard);
            loader.SetShaderForMaterialType(GLTFLoader.MaterialType.CommonConstant, GLTFConstant);
            loader.Multithreaded = Multithreaded;
            loader.MaximumLod    = MaximumLod;
            yield return(loader.Load());
        }