コード例 #1
0
    protected override void Initialise()
    {
        inputManager = new InputManager();
        currentLevel = startingLevel;
        UpdateMoonPosition();

        playerGameItem.SetFlip(true);
        playerRb.velocity = AppManager.INSTANCE.AppModel.playerVelocity;
        playerRb.position = playerGameItem.transform.position = new Vector3(playerStartX, AppManager.INSTANCE.AppModel.playerY, playerRb.position.z);

        DrawLevel();

        isJumping = Mathf.Abs(playerRb.velocity.y) < 0.1f;
        UpdatePlayerAnim();
    }
コード例 #2
0
    protected void DoorStateLogic()
    {
        if (isDelay)
        {
            return;
        }

        if (!doorOpen)
        {
            doorOpen = true;
            houseRenderer.material.SetTexture("_MainTex", doorTexture);
            houseRenderer.material.SetTexture("_EmissionMap", doorTexture);

            doorGameObject.SetActive(true);

            roomAudioSource.Stop();
            roomAudioSource.clip = doorAudioClip;
            roomAudioSource.Play();
        }

        if (timingTimeInState >= currentIntroState.timing)
        {
            player.gameObject.SetActive(true);

            playerRb = player.GetComponent <Rigidbody>();

            player.SetFlip(true);
            player.ChangeAnim(PlayerAnimType.Walk);

            playerRb.AddForce(Vector3.right * 5f, ForceMode.Impulse);

            keysGameObject.SetActive(true);

            FlipKeys(0);

            NextState();
            return;
        }
    }