Exemple #1
0
 public override void Shoot()
 {
     if (audioTimer < -0.9f)
     {
         audioTimer = timerRate;
     }
     laserObj.SetActive(InputKeys.isDown(InputKeys.SHOOT) && equipped);
     if (InputKeys.isDown(InputKeys.SHOOT) && equipped)
     {
         //laserObj.SetActive(true); //should be able to migrate this here, but being cautious.
         audioTimer += Time.deltaTime;
         if (audioTimer >= timerRate) //prevents audio manager spamming
         {
             audioManager.PlayLoopedSound("Laserbeam");
             audioTimer -= timerRate;
         }
     }
     else  //should be unused now, but sleepy and 'aint broke' mentality.
     {
         if (audioTimer > 0.0f)
         {
             audioManager.StopSound("Laserbeam");
             audioTimer = 0.0f;
         }
     }
 }
Exemple #2
0
    void Fire()
    {
        if (InputKeys.isDown(InputKeys.SHOOT) && equipped)
        {
            hitbox.enabled = true;
            em.enabled     = true;
            audioTimer    += Time.deltaTime;
            if (audioTimer >= timerRate)  //will only send audio request every .25s.
            {
                audioTimer -= timerRate;
                audioManager.PlayLoopedSound("Flamethrower1");
                print("TOLD MANAGER TO PLAY SOUND");
            }
        }

        if (InputKeys.isPressed(InputKeys.SHOOT) && equipped)
        {
            hitbox.enabled = true;
            em.enabled     = true;
            if (!firing)
            {
                firing = true;
                //audioManager.PlaySound("Flamethrower1");
            }
        }
    }
Exemple #3
0
 public void ActivateAbility4()
 {
     if (InputKeys.isDown(InputKeys.ABL4) && !abilitySlots[3].passive)
     {
         abilitySlots[3].Activate();
     }
 }
Exemple #4
0
 private void Shoot()
 {
     if (InputKeys.isDown(InputKeys.SHOOT))
     {
         foreach (WeaponModule wep in weaponModules)
         {
             wep.Shoot();
         }
     }
 }
Exemple #5
0
 public void OnPointerEnter(PointerEventData eventData)
 {
     if (equipped && !InputKeys.isDown(InputKeys.SHOOT))
     {
         inst = Instantiate(info) as GameObject;
         inst.transform.parent     = transform.parent.parent.parent;
         inst.transform.localScale = new Vector2(1, 1);
         inst.transform.position   = new Vector2(transform.position.x + 50, transform.position.y - 75);
         inst.GetComponent <AbilityInfoPanelHover> ().HoverSet(nameUI, extraUI);
     }
     Debug.Log("Mouse Enter");
 }
Exemple #6
0
 // Update is called once per frame
 protected override void Update()
 {
     base.Update();
     if (!InputKeys.isDown(InputKeys.SHOOT))
     {
         if (audioTimer > 0.0f)
         {
             audioManager.StopSound("Laserbeam");
             audioTimer = -1.0f;
         }
         laserObj.SetActive(false);
     }
 }
Exemple #7
0
 public void OnPointerEnter(PointerEventData eventData)
 {
     if (equipped && !InputKeys.isDown(InputKeys.SHOOT))
     {
         inst = Instantiate(info) as GameObject;
         inst.transform.parent     = transform.parent.parent.parent;
         inst.transform.localScale = new Vector2(1, 1);
         inst.transform.position   = new Vector2(transform.position.x + 50, transform.position.y - 75);
         inst.GetComponent <InfoPanelScriptHover> ().HoverSet(nameUI, (int)damageUI, (int)firerateUI, GetComponent <WeaponDraggable>());
     }
     AudioManager.instance.PlaySound("HoverBeep");
     Debug.Log("Mouse Enter");
 }
Exemple #8
0
    void Fire()
    {
        if (InputKeys.isDown(InputKeys.SHOOT))
        {
            hitbox.enabled = true;
            em.enabled     = true;
        }

        if (InputKeys.isPressed(InputKeys.SHOOT))
        {
            hitbox.enabled = true;
            em.enabled     = true;
            if (!firing)
            {
                firing = true;
                audioManager.PlaySound("DarkWeapon");
            }
        }
    }
Exemple #9
0
    // Update is called once per frame
    void Update()
    {
        print(pos);
        if (pos < tut.Length && !tut[pos].activeSelf)
        {
            if (pos == 6 && !inventPanel.gameObject.activeSelf)
            {
                tut [pos].SetActive(true);
            }
            else if (pos != 6)
            {
                tut [pos].SetActive(true);
            }
        }

        if (Input.GetKeyDown(KeyCode.G))
        {
            SceneManager.LoadScene("Title");
            Global.tutorial = false;
        }

        if (Input.GetKeyDown(KeyCode.Mouse0))
        {
            if (pos != 2 && pos != 3 && pos != 4 && pos != 5 && pos != 10 && pos != 11 && pos != 9)
            {
                pos++;
                for (int i = 0; i < tut.Length; i++)
                {
                    tut [i].SetActive(false);
                }
            }
        }
        if (pos == 2)
        {
            if ((equipped.GetChild(3).name == "Basic (1)" && equipped.GetChild(2).name == "Basic (2)") ||
                (equipped.GetChild(2).name == "Basic (1)" && equipped.GetChild(3).name == "Basic (2)"))
            {
            }
            else
            {
                pos++;
                for (int i = 0; i < tut.Length; i++)
                {
                    tut [i].SetActive(false);
                }
            }
        }
        if (pos == 3)
        {
            if (!abilityactive.activeSelf)
            {
            }
            else
            {
                pos++;
                for (int i = 0; i < tut.Length; i++)
                {
                    tut [i].SetActive(false);
                }
            }
        }
        if (pos == 4)
        {
            if (inventPanel.GetComponent <AbilityDragger>())
            {
                if (inventPanel.GetComponent <AbilityDragger>().tutDrag)
                {
                    pos++;
                    for (int i = 0; i < tut.Length; i++)
                    {
                        tut [i].SetActive(false);
                    }
                }
            }
        }
        if (pos == 5)
        {
            if (!okcheck.activeSelf)
            {
                pos++;
                for (int i = 0; i < tut.Length; i++)
                {
                    tut [i].SetActive(false);
                }
                p.canMove  = false;
                p.canShoot = false;
            }
        }

        /*if(pos == 8){
         *      if (Input.GetKeyDown (KeyCode.Mouse0)) {
         *              for(int i = 0; i < tut.Length; i++){
         *                      tut [i].SetActive (false);
         *              }
         *              stageProgressTracker.setActiveNode (1);
         *              stageProgressTracker.setCompleteNode (0);
         *              pos++;
         *      }
         * }
         */
        if (pos == 6)
        {
            if (!okcheck.gameObject.activeSelf)
            {
                if (Input.GetKeyDown(KeyCode.Mouse0))
                {
                    for (int i = 0; i < tut.Length; i++)
                    {
                        tut [i].SetActive(false);
                    }
                    pos++;
                }
            }
        }
        if (pos == 9 && !node)
        {
            node = true;
            stageProgressTracker.setCompleteNode(0);
            stageProgressTracker.setActiveNode(1);
        }
        if (pos == 9 && node)
        {
            if (InputKeys.isDown(InputKeys.UP) ||
                InputKeys.isDown(InputKeys.DOWN) ||
                InputKeys.isDown(InputKeys.LEFT) ||
                InputKeys.isDown(InputKeys.RIGHT))
            {
                p.canMove = true;;
                pos++;
                for (int i = 0; i < tut.Length; i++)
                {
                    tut [i].SetActive(false);
                }
            }
        }
        if (pos == 10 && Input.GetKeyDown(KeyCode.Mouse0))
        {
            pos++;
            for (int i = 0; i < tut.Length; i++)
            {
                tut [i].SetActive(false);
            }
            p.canShoot = true;
        }
        if (pos == 11)
        {
            if (!spawner.activeSelf)
            {
                spawner.SetActive(true);
            }
        }
    }
Exemple #10
0
 private void Move()
 {
     if (Input.GetKeyDown(KeyCode.O))
     {
         health += 10;
     }
     //if (!frozen) {
     //	speedModified = false;
     //}
     if (!frozen)
     {
         if (InputKeys.isDown(InputKeys.SLOW))
         {
             playerSpeedMultiplier = 0.5f;
         }
         else if (!InputKeys.isDown(InputKeys.SLOW))
         {
             playerSpeedMultiplier = 1.0f;
         }
     }
     else
     {
         playerSpeedMultiplier = 0.3f;
     }
     if (frozenCounter >= 0)
     {
         frozenCounter -= Time.deltaTime;
     }
     else
     {
         frozen = false;
     }
     if (InputKeys.isDown(InputKeys.RIGHT))
     {
         if (transform.position.x < boundsX2)
         {
             transform.position = new Vector2(transform.position.x + (speed * playerSpeedMultiplier * Time.deltaTime), transform.position.y);
         }
     }
     if (InputKeys.isDown(InputKeys.LEFT))
     {
         if (transform.position.x > boundsX1)
         {
             transform.position = new Vector2(transform.position.x - (speed * playerSpeedMultiplier * Time.deltaTime), transform.position.y);
         }
     }
     if (InputKeys.isDown(InputKeys.UP))
     {
         if (transform.position.y < boundsY2)
         {
             transform.position = new Vector2(transform.position.x, transform.position.y + (speed * playerSpeedMultiplier * Time.deltaTime));
         }
     }
     if (InputKeys.isDown(InputKeys.DOWN))
     {
         if (transform.position.y > boundsY1)
         {
             transform.position = new Vector2(transform.position.x, transform.position.y - (speed * playerSpeedMultiplier * Time.deltaTime));
         }
     }
 }