Example #1
0
 public void HideHelpMenu()
 {
     SoundManagerScript.StopSound("Story");
     //helpPanel.SetActive(false);
     currentHelpPanel = helpPanel;
     helpPanel.SetActive(false);
     helpPanelPage2.SetActive(false);
 }
    public void DisplayNextSentence()
    {
        if (sentences.Count == 0)
        {
            EndDialogue();
            return;
        }
        string sentence = sentences.Dequeue();

        StopAllCoroutines();
        SoundManagerScript.StopSound();
        StartCoroutine(TypeSentence(sentence, character));
    }
Example #3
0
        public void MutePlayHelpMenuStory()
        {
            Debug.LogFormat(" MutePlayHelpMenuStory {0}", SoundManagerScript.GetSoundResource("Story").isPlaying);

            if (SoundManagerScript.GetSoundResource("Story").isPlaying)
            {
                SoundManagerScript.StopSound("Story");
            }
            else
            {
                SoundManagerScript.PlayLongSound("Story");
            }
        }
 void EndDialogue()
 {
     ending = true;
     read   = true;
     animator.SetBool("IsOpen", false);
     exitend.SetActive(true);
     panelAnimator.SetBool("visible", true);
     move.Invoke();
     unlockAbility.Invoke();
     SoundManagerScript.StopSound();
     if (!isEmotional)
     {
         SoundManagerScript.PlaySound("power");
     }
 }
    public void DisplayNextSentence()
    {
        if (talk.Count == 0)
        {
            EndDialogue();
            return;
        }
        DialogueSpecial temp = talk.Dequeue();

        person.text = temp.name;
        character   = person.text;
        string s = temp.sentence;

        StopAllCoroutines();
        SoundManagerScript.StopSound();
        StartCoroutine(TypeSentence(s, character));
    }
Example #6
0
    private void FixedUpdate()
    {
        if (move != 0 && !isDashing)
        {
            rb.velocity = new Vector2(runSpeed * move * Time.fixedDeltaTime, rb.velocity.y);
        }

        if (move == 0 && !isDashing)
        {
            rb.velocity = new Vector2(runSpeed * move * Time.fixedDeltaTime, rb.velocity.y);
        }

        if (dash != 0 && !isDashCooldown)
        {
            colliders[0].enabled = true;
            for (int i = 1; i < colliders.Length; i++)
            {
                colliders[i].enabled = false;
            }
            dash           = 0;
            isDashCooldown = true;
            DisallowMovement();
            Invoke("removeDashCooldown", cooldownDashTime);
            coroutine = StopPlayerPositionUntilSecondsThenDoDash(dashWaitTime);
            StartCoroutine(coroutine);
        }

        if (isDashing)
        {
            DisallowMovement();
            if (transform.localScale.x > 0)
            {
                rb.velocity = transform.right * dashSpeed * Time.fixedDeltaTime;
            }
            else
            {
                rb.velocity = transform.right * -dashSpeed * Time.fixedDeltaTime;
            }
            Invoke("notDashing", dashTime);
        }

        //rb.velocity = new Vector2(runSpeed * move * Time.fixedDeltaTime, rb.velocity.y);



        if (special != 0 && !isSpecialCooldown)
        {
            isSpecialCooldown = true;
            animator.SetBool("2_Up", true);
            if (soundManager != null)
            {
                soundManager.PlaySound("SpecialSound");
            }
            Invoke("removeSpecialCooldown", cooldownSpecialTime);
            rb.velocity = Vector2.zero;
            rb.AddForce(new Vector2(0f, specialForce));
            Instantiate(specialAttackObject, lauchnSpecialAttack.position, Quaternion.identity);
        }



        if (move != 0 && allowmovement && (Time.time - stepTime > 0.5f) && collision && soundManager != null) /*Deletar soundManager != null posteriormente*/
        {
            soundManager.PlaySound("RunSound");
            stepTime = Time.time;
        }
        if (move == 0 && soundManager != null) /*Deletar soundManager != null posteriormente*/
        {
            soundManager.StopSound("RunSound");
        }

        Flip(move);
        if (jump != 0)
        {
            Jump();
        }

        /* //Pulo Daniel
         *      if (jumpUp == true)
         *      {
         *          Debug.Log("up" + jumpUp);
         *          timeJumpUp = Time.time;
         *      }
         *
         *      if (jumpDown == true)
         *      {
         *          Debug.Log("down" + jumpDown);
         *          timeJumpDown = Time.time;
         *      }
         *
         *      //  Debug.Log(timeJumpUp - timeJumpDown);
         *
         *      if (jumpUp && (timeJumpUp - timeJumpDown) <= 0.25f)
         *      {
         *          //Debug.Log("jump curto");
         *          Jump(shortJumpForce);
         *      }
         *
         *      if (jumpUp && (timeJumpUp - timeJumpDown) > 0.25f)
         *      {
         *          //Debug.Log("jump longo");
         *          Jump(longJumpForce);
         *      }
         */

        if (fall && allowFall)
        {
            Fall();
        }

        if (rb.velocity.y > 0.5 && !collision)
        {
            animator.SetBool("Up", true);
            animator.SetBool("Down", false);
        }

        if (rb.velocity.y < -0.5 && !collision)
        {
            animator.SetBool("Down", true);
            animator.SetBool("Up", false);
            animator.SetBool("2_Up", false);
        }
    }
    void Update()
    {
        if (paused || gameOver)
        {
            return;
        }

        if (Input.GetMouseButtonDown(0))
        {
            Shoot();

            //PREP CHARGE SHOT
        }
        else if (Input.GetMouseButtonDown(1))
        {
            holdTimer      = Time.time;
            activateCharge = true;
        }

        //HOLD CHARGE
        if (activateCharge && !charging)
        {
            if (Time.time - holdTimer > holdTime)
            {
                chargeTimer = Time.time;
                charging    = true;
                chargingParticle.Play();
                lineParticles.Play();
                SoundManagerScript.PlaySound("charge");
                cannonTransform.DOLocalMoveZ(cannonLocalPos.z - .22f, chargeTime);

                foreach (GameObject cannonLight in cannonLights)
                {
                    Light light = cannonLight.transform.GetComponent <Light>();
                    light.color = new UnityEngine.Color(1.0f, .49f, 0.0f, 1.0f);
                    light.range = 0.5f;
                    light.DOIntensity(50.0f, 1.0f);
                }
            }
        }

        //CHARGING
        if (charging && !charged)
        {
            if (Time.time - chargeTimer > chargeTime)
            {
                charged = true;
                chargedParticle.Play();
                chargedParticle.transform.localScale = Vector3.zero;
                chargedParticle.transform.DOScale(1, .4f).SetEase(Ease.OutBack);
                chargedEmission.Play();
            }
        }

        //RELEASE
        if (Input.GetMouseButtonUp(1))
        {
            SoundManagerScript.StopSound();
            activateCharge = false;

            if (!charged)
            {
                muzzleFlash.Play();
                cannonParticleShooter.Play();
                SoundManagerScript.PlaySound("fire");
                GameEventsScript.shotCannon.Invoke();
            }
            else if (charged)
            {
                muzzleFlash.Play();
                chargedCannonParticle.Play();
                SoundManagerScript.PlaySound("fire");
                GameEventsScript.shotCannon.Invoke();
            }

            charging = false;
            charged  = false;
            chargedParticle.transform.DOScale(0, .05f).OnComplete(() => chargedParticle.Clear());
            chargedParticle.Stop();
            lineParticles.Stop();

            Sequence s = DOTween.Sequence();
            s.Append(cannonTransform.DOPunchPosition(new Vector3(0, 0, -punchStrength), punchDuration, punchVibrato, punchElasticity));
            foreach (GameObject cannonLight in cannonLights)
            {
                Light light = cannonLight.transform.GetComponent <Light>();
                s.Append(light.DOIntensity(0.0f, 0.25f));
            }
            s.Join(cannonTransform.DOLocalMove(cannonLocalPos, punchDuration).SetDelay(punchDuration));
        }
    }