Exemplo n.º 1
0
 public void ShootOutline(Vector3 GunPoint, Quaternion PointerRotation)
 {
     if (CanShoot && AS.CheckCanShootSecondary())
     {
         if (!POutline.activeSelf)
         {
             POutline.SetActive(true);
         }
         POutline.transform.position = GunPoint;
         POutline.transform.rotation = PointerRotation;
     }
 }
Exemplo n.º 2
0
 public void Shoot(Vector3 GunPoint, Quaternion PointerRotation)
 {
     if (CanShoot && AS.CheckCanShootSecondary())
     {
         SPS.playGrenadeToss();
         POutline.SetActive(false);
         GameObject TMP = OPWall.FetchObject();
         TMP.transform.position = GunPoint;
         TMP.transform.rotation = PointerRotation;
         TMP.GetComponent <SpriteRenderer>().color = ES.GetColor(PCS.GetPlayerNum());
         TMP.SetActive(true);
         AS.ConsumeSecondaryAmmo();
     }
 }
Exemplo n.º 3
0
 public void ShootOutline(Vector3 GunPoint, Quaternion PointerRotation)
 {
     if (!POutline.activeSelf && CanShoot && AS.CheckCanShootSecondary())
     {
         POutline.SetActive(true);
         PCS.SetCanShootPrim(false);
         AS.ConsumeSecondaryAmmo();
         Invoke("turnOff", 2f);
         SPS.PlayShieldUp();
         CanShoot = false;
     }
     if (POutline.activeSelf)
     {
         POutline.transform.position = GunPoint;
         POutline.transform.rotation = PointerRotation;
     }
 }
Exemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        ES  = GameObject.Find("EternalHolder").GetComponent <EternalScript> ();
        SPS = GameObject.Find("SoundObject").GetComponent <SoundPlayerScript> ();
        PCS = GetComponent <PlayerControlScript> ();
        AS  = GetComponent <AmmoScript>();
        AS.SetSecondaryMagazineSize(2);
        PCS.SetSecondaryWeapon(ShootOutline);
        PCS.SetSecondaryWeaponRelease(Shoot);
        CanShoot   = true;
        projectile = Resources.Load("ShieldPrefab") as GameObject;
        POutline   = Instantiate(projectile, Vector3.zero, Quaternion.identity) as GameObject;
        Color CtoChange = ES.GetColor(PCS.GetPlayerNum());

        CtoChange.a = .75f;
        POutline.GetComponent <SpriteRenderer> ().color = CtoChange;
        POutline.SetActive(false);
    }
Exemplo n.º 5
0
 void turnOff()
 {
     PCS.SetCanShootPrim(true);
     SPS.PlayShieldDown();
     POutline.SetActive(false);
 }