E ae Galera!!

Esse é o Blog do Canal Games Indie e eu sou o Bruno, aqui tentarei trazer notícias, vídeos, analises, tutoriais e mais um montão de coisas que no canal do youtube não tem como eu trazer! Ou seja mais conteúdo pra quem gosta do Canal!!

Tutorial de Unity 3D - Inventários & Sistemas de Craft #3 - Troca de Itens no Inventário - [SCRIPT BancoDeDadosItens]


Seguei ai o também script é só copiar e colar no seu Monodevelop!! =] 


//BANCO DE DADOS ITENS



#pragma strict

class Item{
  var Indice    : int;
  var Nome      : String;
  var EstoqueMax: int;
  var Textura   : Texture;
 // var Prefab    : GameObject;
}

var Itens : Item[];

function Start () {

}

function Update () {

}

 function RetornaNomeItem(indice: int) : String
 {
   
   for (var i: int =0;i<Itens.Length;i++)
   {
     if (Itens[i].Indice == indice )
     return Itens[i].Nome;
   }
 }

 function RetornaTexturaItem(indice: int) : Texture
 {
   
   for (var i: int =0;i<Itens.Length;i++)
   {
     if (Itens[i].Indice == indice )
     return Itens[i].Textura;
   }
 }

  function RetornaEstoqueMax(indice: int) : int
 {
   
   for (var i: int =0;i<Itens.Length;i++)
   {
     if (Itens[i].Indice == indice )
     return Itens[i].EstoqueMax;
   }
 }



 Seguei ai o vídeo referente ao script:

Nenhum comentário:

Postar um comentário