Exemplo n.º 1
0
 void Start()
 {
     player        = GetComponentInParent <Player>();
     mLineRenderer = aimsight.GetComponent <LineRenderer>();
     gunRange      = Mathf.Abs((laserDirection.position - barrel.position).x);
     lightning     = GetComponent <DigitalRuby.LightningBolt.LightningBoltScript>();
     if (!hasGun)
     {
         GetComponent <SpriteRenderer>().color = new Color(255f, 255f, 255f, 0f);
         gunShadow.color = new Color(255f, 255f, 255f, 0f);
         GetComponent <LineRenderer>().enabled = false;
         mLineRenderer.enabled = false;
         dotsight.GetComponent <SpriteRenderer>().enabled = false;
     }
 }
Exemplo n.º 2
0
 IEnumerator shootLightning(DigitalRuby.LightningBolt.LightningBoltScript lightning, GameObject target)
 {
     // do periodic damage while the target is alive. if target is not alive turn off teh lightning gameobject
     // readyToSwitchTargets = Time.time + 0.1f;
     while (target.activeInHierarchy)
     {
         if (Vector3.Distance(transform.position, target.transform.position) > maxDistance)
         {
             break;
         }
         target.GetComponent <IShockable>().BeShocked(damage, numberOfBounces);
         yield return(new WaitForSeconds(0.25f));
     }
     lightning.gameObject.SetActive(false);
     yield return(null);
 }
Exemplo n.º 3
0
 void Start()
 {
     lightning = GetComponent <DigitalRuby.LightningBolt.LightningBoltScript>();
 }