I have my code, for my weapon:
using UnityEngine;
using System.Collections;
public class Arma : MonoBehaviour {
public static int municao;
GameObject bullet;
GUIText texto;
// Use this for initialization
void Start ()
{
//bullet = GameObject.Find("Bullet");
municao = 10;
texto = GameObject.Find ("qtdMunicao").GetComponent<GUIText>() as GUIText;
}
// Update is called once per frame
void Update () {
texto.text = municao.ToString ();
if(Input.GetKeyDown("i"))
{
if(municao > 0)
{
Instantiate(bullet, transform.position, transform.rotation);
municao--;
}
}
}
}
`
How can i load the prefab to my variable to use in my instantiate?