示例#1
0
    void Start()
    {
        ctrl           = FindObjectOfType <Ctrl>();
        playerMovement = FindObjectOfType <PlayerMovement>();

        ctrl.transform.Rotate(270, 180, 0);                                   //플레이어 시작로테이트
        ctrl.transform.position = new Vector3(-300, 1, -300);                 //플레이어위치
        ctrl.transform.GetChild(0).GetComponent <Animator>().enabled = false; //에니메이터 멈춤
        ctrl.enabled           = false;                                       //동작멈춤
        playerMovement.enabled = false;                                       //동작구현멈춤

        isClear = PlayerPrefs.GetInt(saveStr, 0);

        talkEffect = GetComponent <TalkEffect>();
        if (isClear < 10)
        {
            ctrl.transform.position = new Vector3(85, 1, 15);//플레이어위치
            StartCoroutine(QuestPlay());
            FindObjectOfType <NPC_DASHIDA>().AddObject("Quest1", "DASHI_A_start");
        }
        else if (isClear == 10)
        {
            ctrl.transform.position = new Vector3(85, 1, 15);
            FindObjectOfType <NPC_DASHIDA>().AddObject("Quest1", "DASHI_A_start");
            ctrl.enabled           = true;
            playerMovement.enabled = true;
        }
        else
        {
            ctrl.enabled           = true;
            playerMovement.enabled = true;
        }
    }
示例#2
0
    void Start()
    {
        // 대사집을 불러옴
        TextAsset TalkAsset = Resources.Load("00Json/CharaterScript") as TextAsset;
        string    jsonData  = TalkAsset.text;

        TutorialScript = JsonUtility.FromJson <TalkScript>(jsonData);

        //필요한 컴포넌트 연결
        pc         = GetComponent <PhaseCtrl>();
        talkEffect = GetComponent <TalkEffect>();
    }
示例#3
0
    TalkEffect te;                 // 토크이펙트

    void Start()
    {
        pc = GetComponent <PhaseCtrl>();                                // 컴포넌트연결
        te = GetComponent <TalkEffect>();                               // 컴포넌트연결

        pc.CreateFourMiniMap();                                         // 선택지로 보여줄 미니맵 생성

        RightEndPos  = Right.position + (Vector3.right * Screen.width); // 가림막 도착지점
        LeftEndPos   = Left.position + (-Vector3.right * Screen.width); // 가림막 도착지점
        TopEndPos    = Top.position + (Vector3.up * Screen.height);     // 가림막 도착지점
        BottomEndPos = Bottom.position + (-Vector3.up * Screen.height); // 가림막 도착지점
    }
示例#4
0
 protected virtual void Start()
 {
     ctrl           = FindObjectOfType <Ctrl>();
     playerMovement = FindObjectOfType <PlayerMovement>();
     panel          = GameObject.Find("ChattingCanvas").transform.GetChild(0).gameObject;
     panel.SetActive(true);
     panelImage = panel.gameObject.GetComponentInChildren <Image>();
     panelText  = panel.gameObject.GetComponentInChildren <Text>();
     panel.SetActive(false);
     talkEffect = GetComponent <TalkEffect>();
     tentPrefab = Resources.Load("Prefabs/buildings/tent", typeof(GameObject)) as GameObject;
     NPCdashida = FindObjectOfType <NPC_DASHIDA>();
 }
示例#5
0
    private void OnEnable()
    {
        ctrl           = FindObjectOfType <Ctrl>();
        playerMovement = FindObjectOfType <PlayerMovement>();
        panel          = GameObject.Find("ChattingCanvas").transform.GetChild(0).gameObject;
        panel.SetActive(true);
        panelImage = panel.gameObject.GetComponentInChildren <Image>();
        panelText  = panel.gameObject.GetComponentInChildren <Text>();
        panel.SetActive(false);
        talkEffect = GetComponent <TalkEffect>();

        ctrl.enabled           = false;
        playerMovement.enabled = false;

        StartCoroutine(QuestStart());
    }
示例#6
0
    IEnumerator CommentPrinter(string comment)
    {   // 입력받은 코멘트를 순차적으로 출력하는 코루틴
        yield return(null);

        JoyStickManager.Instance.CanvasDisable(); // 조이스틱을 가려 채팅이 가려지지않게함

        if (panel == null)
        {
            panel = GameObject.Find("ChattingCanvas").transform.GetChild(0).gameObject;
        }
        if (button == null)
        {
            button = GameObject.Find("ChattingCanvas").transform.GetChild(1).gameObject;
        }

        // 필요한 변수가 null이 아닌지 체크
        panel.SetActive(true);
        if (panelImage == null)
        {
            panelImage = panel.gameObject.GetComponentInChildren <Image>();
        }
        if (panelText == null)
        {
            panelText = panel.gameObject.GetComponentInChildren <Text>();
        }
        panel.SetActive(false);
        if (talkEffect == null)
        {
            talkEffect = FindObjectOfType <TalkEffect>();
        }

        int  commentIdx = 0;
        bool isClick    = true;

        panel.SetActive(true);                                                   // 텍스트 패널 활성화
        button.SetActive(true);                                                  // 스킵버튼 활성화

        yield return(StartCoroutine(talkEffect.FadeInObject(panelImage, 0.5f))); // 패널이 서서히 나타남

        yield return(null);

        panelText.text = "";
        while (commentIdx < comment.Length && !stopComment)
        {
            if (!panel.activeSelf)
            {
                panel.SetActive(true);             // 패널이 꺼진경우 다시 켬
            }
            panelText.text += comment[commentIdx]; // 텍스트를 한글자씩 추가함
            commentIdx++;
            if (Input.GetMouseButtonDown(0))
            {   // 사용자 입력이 있는경우 텍스트가 끝까지 한번에 출력됨
                panelText.text = comment;
                commentIdx     = comment.Length;
            }
            yield return(new WaitForSeconds(0.03f));
        }

        yield return(null);

        while (isClick && !stopComment)
        {   // 출력이 완료되면 사용자 입력을 기다림
            if (Input.GetMouseButtonDown(0))
            {
                isClick = false;
            }
            yield return(null);
        }
        panelText.text = "";
        panel.SetActive(false);  // 패널 비활성화
        button.SetActive(false); // 버튼 비활성화

        stopComment = false;

        yield return(null);

        JoyStickManager.Instance.CanvasAble();
    }
示例#7
0
    IEnumerator CommentPrinter(string[] comment)
    {   // 오버로드함수
        yield return(null);

        JoyStickManager.Instance.CanvasDisable();

        if (panel == null)
        {
            panel = GameObject.Find("ChattingCanvas").transform.GetChild(0).gameObject;
        }
        if (button == null)
        {
            button = GameObject.Find("ChattingCanvas").transform.GetChild(1).gameObject;
        }

        panel.SetActive(true);
        if (panelImage == null)
        {
            panelImage = panel.gameObject.GetComponentInChildren <Image>();
        }
        if (panelText == null)
        {
            panelText = panel.gameObject.GetComponentInChildren <Text>();
        }
        panel.SetActive(false);
        if (talkEffect == null)
        {
            talkEffect = FindObjectOfType <TalkEffect>();
        }

        bool isClick = true;

        panel.SetActive(true);
        button.SetActive(true);

        yield return(StartCoroutine(talkEffect.FadeInObject(panelImage, 0.5f)));

        yield return(null);

        for (int i = 0; i < comment.Length; i++)
        {
            int commentIdx = 0;
            panelText.text = "";
            while (commentIdx < comment[i].Length && !stopComment)
            {
                if (!panel.activeSelf)
                {
                    panel.SetActive(true);
                }

                panelText.text += comment[i][commentIdx];
                commentIdx++;
                if (Input.GetMouseButtonDown(0))
                {
                    panelText.text = comment[i];
                    commentIdx     = comment[i].Length;
                }
                yield return(new WaitForSeconds(0.03f));
            }
            yield return(null);

            while (isClick && !stopComment)
            {
                if (Input.GetMouseButtonDown(0))
                {
                    isClick = false;
                }
                yield return(null);
            }
            isClick = true;
        }

        panelText.text = "";
        panel.SetActive(false);
        button.SetActive(false);

        stopComment = false;

        yield return(null);

        JoyStickManager.Instance.CanvasAble();
    }
示例#8
0
    public Image[] minimapButton;        // 미니맵버튼


    private void Start()
    {
        ct = GetComponent <CharacterTalk>();
        te = GetComponent <TalkEffect>();
    }