일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 몽고디비
- 김양재 목사님
- 빅데이타
- 확률
- 딥러닝
- Statistics
- Artificial Intelligence
- Big Data
- data science
- R
- 빅 데이타
- 빅데이터
- node.js
- 김양재
- 빅 데이터
- openCV
- 김양재 목사
- Machine Learning
- 주일설교
- 통계
- MongoDB
- WebGL
- 인공지능
- nodeJS
- c++
- Deep learning
- probability
- 데이터 과학
- 우리들교회
- No SQL
Archives
- Today
- Total
Scientific Computing & Data Science
Loading a PNG as a Texture (JavaScript) 본문
#pragma strict var imageCount : int = 0; var imageNameBase : String = ""; var imageNameZeroPadding : int = 0; var changeInterval : float = 0.06; var isRunning = false; var isLooping = false; private var texture : Texture = null; function PlayRocket () { isRunning = true; } function Start () { var isRunning = false; var fileName : String = imageNameBase + ZeroPad(0,imageNameZeroPadding); texture = Resources.Load(fileName); } function Update () { if( isRunning == true) { PNGAnimation (); } } function PNGAnimation () { var index : int = Time.time/changeInterval; index = index % imageCount; var fileName : String = imageNameBase + ZeroPad(index,imageNameZeroPadding); Resources.UnloadAsset(texture); texture = Resources.Load(fileName); renderer.material.mainTexture = texture; if ( index == imageCount-1){ Debug.Log("End of Animation"); Debug.LogWarning("End of Animation"); if( isLooping == false){ isRunning = false; } fileName = imageNameBase + ZeroPad(0,imageNameZeroPadding); Resources.UnloadAsset(texture); texture = Resources.Load(fileName); renderer.material.mainTexture = texture; } } function ZeroPad(number : int, size : int) { var numberString : String = number.ToString(); while (numberString.Length
}
'CG & Video Games > Unity 3D' 카테고리의 다른 글
Unite 2012 - Unity, Network Code and You (0) | 2013.06.03 |
---|---|
Unite 12 - Mecanim : Creating Retagetable Animation in Unity 4 (0) | 2013.05.28 |
How to Make a Game? - 04.Development (0) | 2013.05.26 |
How to Make a Game? - 03.Design (0) | 2013.05.26 |
How to Make a Game? - 02.System Planning (0) | 2013.05.26 |
Comments