Graphics Reference
In-Depth Information
public void InitThis()
{
// cache our transform
myTransform= transform;
// cache our gameObject
myGO= gameObject;
if(weaponControl==null)
{
// try to find weapon controller on this gameObject
weaponControl= myGO.GetComponent
<Standard_SlotWeaponController>();
}
if(rendererToTestAgainst==null)
{
// we need a renderer to find out whether or not we
// are on screen, so let's try and find one in our
// children if we don't already have one set in the
// editor
rendererToTestAgainst= myGO.GetComponentInChildren
<Renderer>();
}
// if a player manager is not set in the editor, let's try
// to find one
if(myPlayerManager==null)
{
myPlayerManager= myGO.AddComponent
<BasePlayerManager>();
}
myDataManager= myPlayerManager.DataManager;
myDataManager.SetName("Enemy");
myDataManager.SetHealth(thisEnemyStrength);
canFire=true;
didInit=true;
}
private RaycastHit rayHit;
public virtual void Update ()
{
// if we are not allowed to control the weapon, we drop out
// here
if(!canControl)
return;
if(thisGameObjectShouldFire)
{
// we use doFire to determine whether or not to fire
// right now
doFire=false;
// canFire is used to control a delay between firing
if( canFire )
Search WWH ::




Custom Search