일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 김양재 목사님
- c++
- 몽고디비
- nodeJS
- Artificial Intelligence
- 빅 데이터
- Big Data
- 확률
- MongoDB
- 우리들교회
- probability
- 김양재 목사
- 딥러닝
- WebGL
- data science
- No SQL
- 데이터 과학
- node.js
- 빅데이타
- 주일설교
- 빅 데이타
- 통계
- 인공지능
- 빅데이터
- openCV
- Machine Learning
- 김양재
- R
- Deep learning
- Statistics
- Today
- Total
Scientific Computing & Data Science
Dynamic Images 본문
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System;
public class ImageCycle : MonoBehaviour {
public Texture2D LogoTexture = null;
public Rect LogoTextureDimensions;
// Use this for initialization
void Start () {
StartCoroutine(ShowImages());
}
// Update is called once per frame
void Update () {
}
void OnGUI()
{
if(LogoTexture)
GUI.DrawTexture(LogoTextureDimensions, LogoTexture);
}
IEnumerator ShowImages()
{
//Get image files
var set = new HashSet<string> { ".jpg", ".png" };
string[] Files = Directory.GetFiles(Path.GetFullPath("."), "*.*", SearchOption.TopDirectoryOnly)
.Where(f => set.Contains(
new FileInfo(f).Extension,
StringComparer.OrdinalIgnoreCase)).ToArray();
foreach(string FileName in Files)
{
//Create complete path
string FullPath = "file://" + FileName;
FullPath = FullPath.Replace('\\', '/');
WWW URL = new WWW(FullPath);
//Wait for load
yield return URL;
//Load texture
LogoTexture = URL.texture;
//Set texture dimensions
LogoTextureDimensions = new Rect();
LogoTextureDimensions.x = Screen.width/2 - (LogoTexture.width/2);
LogoTextureDimensions.y = Screen.height/2 - (LogoTexture.height/2);
LogoTextureDimensions.width = LogoTexture.width;
LogoTextureDimensions.height = LogoTexture.height;
//Show logo duration
yield return new WaitForSeconds(2);
}
StartCoroutine(ShowImages());
}
}
'CG & Video Games > Unity 3D' 카테고리의 다른 글
Script for Network Instantiate(JS) (0) | 2013.05.26 |
---|---|
Script for Touch & Drag an Object (0) | 2013.05.26 |
VertextLit Shader (0) | 2013.05.26 |
Display Normal Shader (0) | 2013.05.26 |
Rendering with Different Cameras (0) | 2013.05.26 |