Exemple #1
0
    public void FireMainGun()
    {
        if (Input.GetButtonDown("Fire1"))
        {
            UpSound.Invoke();
        }

        if (Input.GetButton("Fire1"))
        {
            StaffANIM.SetBool("TranGrowO", true);
            StaffANIM.SetBool("IsGrowingOBJ", true);

            if (TranGO == true)
            {
                if (mass > 0f)
                {
                    ShootGrow();
                }
                if (mass <= 0f)
                {
                    Debug.Log("NoMass");
                    StaffANIM.SetBool("IsGrowingOBJ", false);
                }
            }
        }
        if (Input.GetButtonUp("Fire1"))
        {
            StaffANIM.SetBool("IsGrowingOBJ", false);
            StaffANIM.SetBool("TranGrowO", false);
            Wipe.Invoke();
            isShooting = false;
            OBJLOC     = StaffPoint.transform.localPosition;
        }
        if (Input.GetButtonDown("Fire2"))
        {
            DownSound.Invoke();
        }

        if (Input.GetButton("Fire2"))
        {
            StaffANIM.SetBool("TranShrinkO", true);
            StaffANIM.SetBool("IsShrinkingOBJ", true);
            if (TranSO == true)
            {
                ShootShrink();
            }
        }
        if (Input.GetButtonUp("Fire2"))
        {
            StaffANIM.SetBool("IsShrinkingOBJ", false);
            StaffANIM.SetBool("TranShrinkO", false);
            EShrinking = false;

            Wipe.Invoke();
            isShooting = false;
            OBJLOC     = new Vector3(0f, 0f, 0f);
        }
    }
Exemple #2
0
    public void ScaleShrinkGrow()
    {
        if (Input.GetButton("Fire1"))
        {
            StaffANIM.SetBool("TranGrowP", true);
            StaffANIM.SetBool("IsGrowingP", true);
            if (TranGP == true)
            {
                if (InVol == false)
                {
                    if (mass > 0f)
                    {
                        Player.transform.localScale = Vector3.Lerp(Player.transform.localScale, new Vector3(PSgrow, PSgrow, PSgrow), Time.deltaTime * PSgrowtime);

                        if (CurrentSize.magnitude <= maxSize.magnitude)
                        {
                            gameManager.GetComponent <GameManager>().MassAvailable -= (GrowTime * Time.deltaTime);
                        }
                        if (CurrentSize.magnitude >= maxSize.magnitude)
                        {
                            Debug.Log("TooLorge");
                        }
                    }
                    if (mass <= 0f)
                    {
                        Debug.Log("NoMass");
                    }
                }
            }
        }

        if (Input.GetButtonDown("Fire1"))
        {
            PlayerUP.Invoke();
            if (TooLorge == true)
            {
                Debug.Log("DeadByLorge");
                Dead.Invoke();
                StartCoroutine(DiedDead(.5f));
            }
        }
        if (Input.GetButtonUp("Fire1"))
        {
            StaffANIM.SetBool("IsGrowingP", false);
            StaffANIM.SetBool("TranGrowP", false);
            Wipe.Invoke();
        }


        if (Input.GetButton("Fire2"))
        {
            StaffANIM.SetBool("TranShrinkP", true);
            StaffANIM.SetBool("IsShrinkingP", true);
            if (InVol == false && TranSP == true)
            {
                Player.transform.localScale = Vector3.Lerp(Player.transform.localScale, new Vector3(PSshrink, PSshrink, PSshrink), Time.deltaTime * PSshrinktime);
                if (CurrentSize.magnitude < avgSize.magnitude)
                {
                    if (CurrentSize.magnitude >= PminSize.magnitude)
                    {
                        gameManager.GetComponent <GameManager>().MassAvailable += (GrowTime * Time.deltaTime) * 1.25f;
                    }
                    if (CurrentSize.magnitude <= PminSize.magnitude)
                    {
                        Debug.Log("smol");
                    }
                }
            }
        }


        if (Input.GetButtonDown("Fire2"))
        {
            PlayerDown.Invoke();
            if (TooSmol == true)
            {
                Debug.Log("DeadBySmol");
                Dead.Invoke();
                StartCoroutine(DiedDead(.5f));
            }
        }
        if (Input.GetButtonUp("Fire2"))
        {
            Wipe.Invoke();
            StaffANIM.SetBool("TranShrinkP", false);
            StaffANIM.SetBool("IsShrinkingP", false);
        }
    }