コード例 #1
0
    IEnumerator Loading()
    {
        yield return(null);

        // yield return new WaitForSeconds(0.01f);
        // ObjectManager.instance.FadeIn(loadIcon);
        // Fade2Manager.instance.FadeIn(0.02f);

        //yield return new WaitForSeconds(0.5f);   //오브젝트 불러오는 시간 필요 (개중요)


        // DialogueManager.instance.ShowDialogue(forLoadDialogue, true);
        // yield return new WaitForSeconds(1f);
        // DialogueManager.instance.ExitDialogue();


        thePlayer.notMove = true;
        if (theDB.phaseNum != 0)
        {
            theSL.CallLoad(theDB.phaseNum);
        }
        // yield return new WaitForSeconds(3f);     // 로딩창 켜져있는 시간 조절



        //Fade2Manager.instance.FadeOut(0.02f,1f);

        // ObjectManager.instance.FadeOut(loadIcon);
        //yield return new WaitForSeconds(2f);
        //loadWindow.SetActive(false);

        thePlayer.LetBegin();
    }
コード例 #2
0
    private void UpdateState()
    {
        if (Input.GetKeyDown(KeyCode.F9))
        {
            // 불러오기
            theSaveNLoad.CallLoad();
        }

        if (Input.GetKeyDown(KeyCode.LeftShift) | Input.GetKeyDown(KeyCode.W) | Input.GetKeyDown(KeyCode.A) | Input.GetKeyDown(KeyCode.S) | Input.GetKeyDown(KeyCode.D))
        {
            theAudio.Play(walk_sound);
            theAudio.SetLoop(walk_sound);
        }
        // 줍기
        if (Input.GetKey(KeyCode.Z))
        {
            movementSpeed = 0;
            animator.SetBool("isWalking", false);
            animator.SetBool("isRun", false);
            animator.SetBool("isPick", true);
        }
        // 줍기
        if (Input.GetKeyUp(KeyCode.Z))
        {
            animator.SetBool("isPick", false);
        }

        if (Mathf.Approximately(movement.x, 0) && Mathf.Approximately(movement.y, 0))
        {
            animator.SetBool("isWalking", false);
            animator.SetBool("isRun", false);
            theAudio.Stop(walk_sound);
        }

        else if ((!Mathf.Approximately(movement.x, 0) | !Mathf.Approximately(movement.y, 0)) && Input.GetKey(KeyCode.LeftShift))
        {
            movementSpeed = 1000;
            animator.SetBool("isRun", true);
            animator.SetBool("isWalking", false);
        }

        else
        {
            movementSpeed = 300;
            animator.SetBool("isWalking", true);
            animator.SetBool("isRun", false);
            animator.SetBool("isPick", false);
        }

        animator.SetFloat("xDir", movement.x);
        animator.SetFloat("yDir", movement.y);
    }
コード例 #3
0
    IEnumerator StartLoadCoroutine(int num)
    {
        //Debug.Log(num + "번 파일 로드 준비");
        theDB.phaseNum = num;
        Fade2Manager.instance.FadeOut(0.02f, 1f);
        yield return(new WaitForSeconds(2f));

        //SceneManager.LoadScene("start");

        theLT.loadWindow.SetActive(true);  //로딩창 온


        yield return(new WaitForSeconds(0.01f));

        ObjectManager.instance.FadeIn(loadIcon);
        Fade2Manager.instance.FadeIn(0.02f);

        yield return(new WaitForSeconds(0.5f));   //오브젝트 불러오는 시간 필요 (개중요)

        thePlayer.notMove = true;


        theSL.CallLoad(num);
        yield return(new WaitForSeconds(2f));

        theBook.BookOff();
        alertPop_Load.SetActive(false);

        thePlayer.exc.SetBool("on", false);
        thePlayer.canInteractWith = 0;

        thePlayer.animator.SetBool("onFish", false);
        FadeManager.instance.fog0.SetActive(false);

        ObjectManager.instance.FadeOut(loadIcon);
        Fade2Manager.instance.FadeOut(0.02f, 1f);


        yield return(new WaitForSeconds(2f));

        theLT.loadWindow.SetActive(false);
        thePlayer.LetBegin();
        //yield return new WaitForSeconds(2f);
        //theSL.CallLoad(num);
    }
コード例 #4
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.F5))
        {
            //저장
            theSaveNLoad.CallSave();
        }

        if (Input.GetKeyDown(KeyCode.F9))
        {
            //로드
            theSaveNLoad.CallLoad();
        }


        if (canMove && !notMove && !attacking)
        {
            if (Input.GetAxisRaw("Horizontal") != 0 || Input.GetAxisRaw("Vertical") != 0)
            {
                canMove = false;
                StartCoroutine(MoveCoroutine());
            }
        }

        if (!notMove && !attacking)
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                currentAttackDelay = attackDelay;
                attacking          = true;
                animator.SetBool("Attacking", true);
            }
        }
        if (attacking)
        {
            currentAttackDelay -= Time.deltaTime;
            if (currentAttackDelay <= 0)
            {
                animator.SetBool("Attacking", false);
                attacking = false;
            }
        }
    }
コード例 #5
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.F5))
        {
            theSaveNLoad.CallSave();
        }
        if (Input.GetKeyDown(KeyCode.F7))
        {
            theSaveNLoad.CallLoad();
        }

        if (canMove && !notMove)
        {
            if (Input.GetAxisRaw("Horizontal") != 0 || Input.GetAxisRaw("Vertical") != 0)
            {
                canMove = false;
                StartCoroutine(MoveCoroutine());
            }
        }
    }
コード例 #6
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.F5))
        {
            theSaveNLoad.CallSave();
        }
        if (Input.GetKeyDown(KeyCode.F7))
        {
            theSaveNLoad.CallLoad();
        }

        //if (canMove == true)
        //{
        //    //Input.GetAxisRaw("Horizontal") : 우 방향키가 눌리면 1, 좌 방향키가 눌리면 -1 리턴
        //    //Input.GetAxisRaw("Vertical") : 상 방향키가 눌리면 1, 하 방향키가 눌리면 -1 리턴
        //    if (Input.GetAxisRaw("Horizontal") != 0 || Input.GetAxisRaw("Vertical") != 0)
        //    {
        //        canMove = false;
        //        StartCoroutine(MoveCoroutine());
        //    }
        //}
    }
コード例 #7
0
 public void Load()
 {
     saveNload.CallLoad();
     //로드
 }
コード例 #8
0
    void Update()
    {
        currentSceneName = SceneManager.GetActiveScene().name;

        if (Input.GetKeyDown(KeyCode.F5))
        {
            theSaveNLoad.CallSave();
        }

        if (Input.GetKeyDown(KeyCode.F9))
        {
            theSaveNLoad.CallLoad();
        }

        if (!attacking && playerMove)
        {
            if (true)
            {
                float h = Input.GetAxisRaw("Horizontal");
                float v = Input.GetAxisRaw("Vertical");
                walking = true;
                if (h > 0)
                {
                    directionX = 1;
                    directionY = 0;
                }
                else if (h < 0)
                {
                    directionX = -1;
                    directionY = 0;
                }
                else if (v > 0)
                {
                    directionX = 0;
                    directionY = 1;
                }
                else if (v < 0)
                {
                    directionX = 0;
                    directionY = -1;
                }
                else
                {
                    walking = false;
                }
                if (walking)
                {
                    transform.Translate(new Vector3(directionX, directionY, 0) * Time.deltaTime * speed);
                    pc.enabled = false;
                }
                if (Input.GetMouseButton(0) || Input.GetKeyDown(KeyCode.Space))
                {
                    attackTimeCounter = attackTime;
                    attacking         = true;
                    animator.SetBool("Hit", true);
                    pc.enabled = true;
                }
                animator.SetFloat("DirectionX", directionX);
                animator.SetFloat("DirectionY", directionY);
                animator.SetBool("Walking", walking);
            }
        }
        if (attackTimeCounter > 0)
        {
            attackTimeCounter -= Time.deltaTime;
        }
        if (attackTimeCounter <= 0)
        {
            attacking = false;
            animator.SetBool("Hit", false);
        }
    }