? 欧美一区二区三区在线观看,AV天堂首页在线播放
聯(lián)系我們

給我們留言

聯(lián)系我們

地址:福建省晉江市青陽(yáng)街道洪山路國(guó)際工業(yè)設(shè)計(jì)園納金網(wǎng)

郵箱:info@narkii.com

電話:0595-82682267

(周一到周五, 周六周日休息)

當(dāng)前位置:主頁(yè) > 3D教程 > 圖文教程

unity3d火焰燃燒常用腳本

來(lái)源: | 責(zé)任編輯:她。 | 發(fā)布時(shí)間: 2017-08-28 14:55 | 瀏覽量:

本節(jié)匯寶盆為大家?guī)?lái)的是:unity3d火焰燃燒常用腳本     
  unity3d貼圖動(dòng)畫(huà)腳本,常用腳本
      一團(tuán)火焰,跳動(dòng),燃燒,希望大家喜歡!
 

var uvAnimationTileX = 24; //Here you can place the number of columns of your sheet.
//The above sheet has 24
var uvAnimationTileY = 1; //Here you can place the number of rows of your sheet.
//The above sheet has 1
var framesPerSecond = 10.0;

function Update () {
// Calculate index
var index : int = Time.time * framesPerSecond;
// repeat when exhausting all frames
index = index % (uvAnimationTileX * uvAnimationTileY);

// Size of every tile
var size = Vector2 (1.0 / uvAnimationTileX, 1.0 / uvAnimationTileY);

// split into horizontal and vertical index
var uIndex = index % uvAnimationTileX;
var vIndex = index / uvAnimationTileX;
// build offset
// v coordinate is the bottom of the image in opengl so we need to invert.
var offset = Vector2 (uIndex * size.x, 1.0 - size.y - vIndex * size.y);

renderer.material.SetTextureOffset ("_MainTex", offset);
renderer.material.SetTextureScale ("_MainTex", size);
}


 


相關(guān)文章
網(wǎng)友評(píng)論

您需要登錄后才可以發(fā)帖 登錄 | 立即注冊(cè)

關(guān)閉

全部評(píng)論:0條

推薦
熱門(mén)