コード例 #1
0
ファイル: BookPart.cs プロジェクト: flow996/streemon
    //item move to point
    IEnumerator itemGotoPoint(Vector3 point)
    {
        _canInteractive            = false;
        interactiveDistance        = 0;
        _spriteRender.sortingOrder = 9;

        if (canPick)
        {
            book.AddDiary(index);
            StartCoroutine(GameManager.game.fadeInOut(Camera.main.GetComponentInChildren <SpriteRenderer>(), 0.08f));
        }
        else
        {
            StartCoroutine(GameManager.game.fadeInOut(Camera.main.GetComponentInChildren <SpriteRenderer>(), -0.18f));
        }
        while (transform.position != point)
        {
            transform.position = Vector3.MoveTowards(transform.position, point, 10.0f * Time.deltaTime);
            yield return(null);
        }
        if (canPick)
        {
            diaryUI.GetComponentInChildren <Text>().text = "獲得了日記本第" + (index + 1) + "頁";
            diaryUI.SetActive(true);
            yield return(new WaitForSeconds(1.0f));

            diaryUI.SetActive(false);
        }
        afterItemGotoPoint();
    }