Thumbnails.Start C# (CSharp) 메소드

Start() 개인적인 메소드

private Start ( ) : void
리턴 void
	void Start () {
		#if UNITY_EDITOR
		for (int i = 0; i < parts.Length; i++) {
			Debug.Log(parts[i]);
			string part = parts[i];
			GameObject o = Resources.Load (part) as GameObject;
//			Material material = Resources.Load (part + "mat", typeof(Material)) as Material;
//			o.GetComponentInChildren<SkinnedMeshRenderer> ().material = material;

			Instantiate (o, new Vector3 (0, 0, 0), Quaternion.identity);
			Texture2D t2d = AssetPreview.GetAssetPreview (o);
			byte[] bytes = t2d.EncodeToPNG ();
			Debug.Log ("Path: " + Application.dataPath + "/Exteel/ExteelScripts/Thumbnails/" + parts [i] + ".png");
			File.WriteAllBytes(Application.dataPath + "/Exteel/ExteelScripts/Thumbnails/" + parts[i]+".png", bytes);
		}
		#endif
	}
}

Usage Example

예제 #1
0
        /// <summary>
        /// Starts the thumbnail download thread
        /// </summary>
        private void startingThumbnailDownload()
        {
            //Starting Thumbnail download
            tsslMessage.Text = "Thumbnail download started.";

            if (Properties.Settings.Default.SimulateCamera)
            {
                thumbnailthread = new Thumbnails("", ref ks2.Filelist);
            }
            else
            {
                thumbnailthread = new Thumbnails(Properties.Settings.Default.IPAdressCamera, ref ks2.Filelist);
            }

            thumbnailthread.NewFrame += thumbnailtread_NewFrame;
            thumbnailthread.Start();

            tbDebug.Text = ks2.Content;
        }
Thumbnails