Пример #1
0
    // AnandaCoord = Warp.Location; set in app

    IEnumerator OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Player")
        {
            // Stops the player's movement
            playerAnim.SetBool("bIsWalking", false);
            player.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0);
            player.bStopPlayerMovement = true;
            touches.UnpressedAllArrows();

            // Fade out
            StartCoroutine(sFader.FadeToBlack());

            yield return(new WaitForSeconds(1.0f));

            cFollow.currentCoords = (CameraFollow.AnandaCoords)AnandaCoord;
            other.gameObject.transform.position = warpTarget.position;
            Camera.main.transform.position      = warpTarget.position;

            // Fade in
            StartCoroutine(sFader.FadeToClear());

            yield return(new WaitForSeconds(1.0f));

            if (areaAni)
            {
                areaAni.CheckAreaToAnimate();
            }

            player.bStopPlayerMovement = false;
        }
    }
    public void ShowDialogue()
    {
        // Sound Effect
        SFXMan.sounds[2].PlayOneShot(SFXMan.sounds[2].clip);

        // Set the text
        //dText.text = dialogueLines[currentLine];
        StartCoroutine(TypewriteText());

        // Set current picture
        dPic.sprite = portPic;

        // Displays the dialogue box & strobing arrow
        bDialogueActive           = true;
        dBox.transform.localScale = Vector3.one;
        StartCoroutine(ResetStrobes());

        // Stops the player's movement
        playerMove.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0);
        if (playerAnim)
        {
            playerAnim.SetBool("bIsWalking", false);
        }

        touches.UnpressedAllArrows();
        playerMove.bStopPlayerMovement = true;

        // Hide BrioBar & Pause Button (Opac)
        uMan.HideBrioAndButton();
    }
    public void CollisionBundle() // Note: order is important
    {
        // Reset Camera dimension / ratio incase screen size changed at all (e.g. WebGL Fullscreen)
        aspectUtil.Awake();

        // "Stop" player animation
        if (playerAnim)
        {
            playerAnim.speed = 0.0001f;
        }

        // Unsync and stop camera tracking
        cameraFollow.currentCoords = 0;

        // Hide UI (if present) and prevent input
        if (cameraSlider)
        {
            cameraSlider.bTempControlActive = uMan.bControlsActive;
        }

        touches.transform.localScale = Vector3.zero; // 05/10/2019 DC TODO -- Change this to uMan.HideControls()?
        touches.UnpressedAllArrows();

        // Prevent player movement
        bStopPlayerMovement = true;

        // Prevent player interactions (e.g. other tripwires)
        if (playerCollider)
        {
            playerCollider.enabled = false;
        }
    }