Graphics Reference
In-Depth Information
[System.NonSerialized]
public Transform theProjectile;
private GameObject theProjectileGO;
private bool isLoaded;
private ProjectileController theProjectileController;
public virtual void Start()
{
Init();
}
public virtual void Init()
{
// cache the transform
myTransform= transform;
// cache the layer (we'll set all projectiles to avoid this
// layer in collisions so that things don't shoot themselves!)
myLayer= gameObject.layer;
// load the weapon
Reloaded();
}
public virtual void Enable()
{
// drop out if firing is disabled
if( canFire==true )
return;
// enable weapon (do things like show the weapons mesh etc.)
canFire=true;
}
public virtual void Disable()
{
// drop out if firing is disabled
if( canFire==false )
return;
// hide weapon (do things like hide the weapons mesh etc.)
canFire=false;
}
public virtual void Reloaded()
{
Search WWH ::




Custom Search