コード例 #1
0
    public void ShowChoiceFrame(string firstText, string secondText, string thirdText, ReactionCollection firstReaction, ReactionCollection secondReaction, ReactionCollection thirdReaction)
    {
        gameObject.SetActive(true);
        this.firstText.text  = firstText;
        this.secondText.text = secondText;
        this.thirdText.text  = thirdText;

        firstButton.onClick.AddListener(delegate {
            transform.parent.GetComponent <TextDisplayer>().reactionButton.enabled = true;
            firstReaction.InitAndReact();
            HideChoiceFrame();
        });
        secondButton.onClick.AddListener(delegate {
            transform.parent.GetComponent <TextDisplayer>().reactionButton.enabled = true;
            secondReaction.InitAndReact();
            HideChoiceFrame();
        });
        thirdButton.onClick.AddListener(delegate {
            transform.parent.GetComponent <TextDisplayer>().reactionButton.enabled = true;
            thirdReaction.InitAndReact();
            HideChoiceFrame();
        });

        StartCoroutine(Visible());
    }
コード例 #2
0
    IEnumerator CheckForGiving()
    {
        FSLocator.textDisplayer.HideDialogueHolder();
        FSLocator.characterDisplayer.HideImage();

        // 인벤토리 간 조작 금지 설정
        FSLocator.textDisplayer.reactionButton.gameObject.SetActive(false);

        // "주다" 버튼이 포함되어 있는 인벤토리 UI 표시
        inventory.OnClickGive(npcName);

        // 사용자가 아이템 선택 후 "주다" 버튼 클릭까지 대기
        while (inventory.giveBg.activeSelf)
        {
            yield return(null);
        }

        FSLocator.textDisplayer.reactionButton.enabled = true;
        // 아이템을 정상적으로 주었다면..
        if (inventory.isGive)
        {
            GoodReactionCollection.InitAndReact();
            inventory.isGive = false;
        }
        // 아이템을 받지 않았다면..
        else
        {
            BadReactionCollection.InitAndReact();
        }

        // 인벤토리 간 조작 금지 해제
        FSLocator.textDisplayer.reactionButton.gameObject.SetActive(true);

        Destroy(myCorotine);
    }
コード例 #3
0
    public void OnClickYes()
    {
        saveReConfirmationDisplayer.SetActive(false);
        loadReConfirmationDisplayer.SetActive(false);

        // 현재 상태 저장
        if (isSave)
        {
            SaveDataSystem save = FindObjectOfType <SaveDataSystem>();

            // 저장
            save.SaveData(conClick);

            // slot 표시 변경
            slots[conClick].Init(true, save.tempData.time, save.tempData.stage, save.tempData.mission);
        }
        // 지정 slot으로 게임 데이터 불러오기
        else
        {
            // 재시작 후 Load 할 데이터 지정
            StaticInfoForSound.playingSlotIndex = conClick;

            // 켜져있는 Canvas 제거
            saveDisplayer.SetActive(false);

            // 재시작
            loadReaction.InitAndReact();
        }
    }
コード例 #4
0
    private IEnumerator End()
    {
        CanvasGroup canvasComponent = GetComponent <CanvasGroup>();

        float alpha = 1;

        while (alpha > 0)
        {
            alpha -= Time.deltaTime;
            canvasComponent.alpha = alpha;
            yield return(null);
        }
        alpha = 0;
        canvasComponent.alpha = alpha;

        if (reaction != null)
        {
            reaction.InitAndReact();
        }
        else
        {
            interact.Interact();
        }

        gameObject.SetActive(false);
    }
コード例 #5
0
    IEnumerator Wating()
    {
        GameObject itemScript = FindObjectOfType <ItemScript>().transform.Find("ReactionButton").gameObject;

        // 아이템 정보를 클릭하였는지 확인하는 리스너 추가
        button.onClick.AddListener(ClickItem);

        // 인벤토리를 열 때 까지 대기
        while (itemScript.activeSelf == false)
        {
            yield return(null);
        }

        // 인벤토리를 끌 때 까지 대기
        while (itemScript.activeSelf == true)
        {
            yield return(null);
        }


        // 인베토리 속 물건을 확인하였는가?
        if (isItemClick)
        {
            afterCheckReaction.InitAndReact();
        }
        else
        {
            CantCheckReaction.InitAndReact();
        }

        FSLocator.textDisplayer.reactionButton.enabled = true;
        Destroy(myCorotine);
    }
コード例 #6
0
    IEnumerator CheckingDistance()
    {
        // 조이스틱 스크립트(조이스틱 사용 유무 판별)
        JoystickScript joystick = GameObject.FindObjectOfType <JoystickScript>();

        // 현재까지 조이스틱 사용 시간
        float conDistance = 0;

        while (true)
        {
            if (joystick.isClicked)
            {
                conDistance += Time.deltaTime;
                if (conDistance > distance)
                {
                    break;
                }
            }
            yield return(null);
        }

        afterReaction.InitAndReact();

        // 이 코루틴 삭제
        Destroy(myCorotine);
    }
コード例 #7
0
    public void OnClickYes()
    {
        // 종료 창을 끈다.
        exitDisplayer.gameObject.SetActive(false);

        exitReaction.InitAndReact();
    }
    IEnumerator Wating()
    {
        GameObject docuScript = FindObjectOfType <DocumentManager>().transform.Find("ReactionButton").gameObject;

        // 문서 정보를 클릭하였는지 확인하는 리스너 추가
        button.onClick.AddListener(ClickInfo);

        // 문서창을 열 때 까지 대기
        while (docuScript.activeSelf == false)
        {
            yield return(null);
        }

        // 문서창을 끌 때 까지 대기
        while (docuScript.activeSelf == true)
        {
            yield return(null);
        }

        button.onClick.RemoveListener(ClickInfo);

        // 조합을 성공하였는가?
        if (isInfoClick)
        {
            afterCheckReaction.InitAndReact();
        }
        else
        {
            CantCheckReaction.InitAndReact();
        }

        FSLocator.textDisplayer.reactionButton.enabled = true;

        Destroy(myCorotine);
    }
コード例 #9
0
    IEnumerator Wating()
    {
        GameObject    itemScript = FindObjectOfType <ItemScript>().transform.Find("ReactionButton").gameObject;
        ContentScript content    = FindObjectOfType <ContentScript>();

        // 인벤토리를 열 때 까지 대기
        while (itemScript.activeSelf == false)
        {
            yield return(null);
        }

        // 인벤토리를 끌 때 까지 대기
        while (itemScript.activeSelf == true)
        {
            yield return(null);
        }

        // 조합을 성공하였는가?
        if (content.IsGottenItem(itemName))
        {
            makeReaction.InitAndReact();
        }
        else
        {
            CantReaction.InitAndReact();
        }

        FSLocator.textDisplayer.reactionButton.enabled = true;

        Destroy(myCorotine);
    }
コード例 #10
0
    IEnumerator Wating()
    {
        while (myCorotine == null)
        {
            yield return(null);
        }

        // 문서 정보를 클릭하였는지 확인하는 리스너 추가
        button.onClick.AddListener(ClickSave);

        // 게임 종료를 클릭하였는가 확인하는 리스너 추가
        endButton.onClick.AddListener(ClickEnd);

        // 게임 불러오기를 클릭하였는가 확인하는 리스너 추가
        loadButton.onClick.AddListener(ClickLoad);

        GameObject settingCanvas = FindObjectOfType <SettingScript>().transform.Find("ReactionButton").gameObject;

        // 환경설정 Displayer을 열 때 까지 대기
        while (settingCanvas.activeSelf == false)
        {
            yield return(null);
        }

        // 환경설정 Displayer을 끌 때 까지 대기
        while (settingCanvas.activeSelf == true)
        {
            yield return(null);
        }

        // 종료 버튼을 눌렀는가?
        if (isEndClick)
        {
            gameEndReaction.InitAndReact();
        }
        // 불러오기를 눌렀는가?
        else if (isLoadClick)
        {
            FindObjectOfType <SettingScript>().GetComponent <SaveManager>().OnClickYes();
        }
        // 그 외
        else
        {
            // 저장 버튼을 눌렀는가?
            if (isSaveClick)
            {
                afterReaction.InitAndReact();
            }
            else
            {
                notReaction.InitAndReact();
            }
        }

        FSLocator.textDisplayer.reactionButton.enabled = true;
        Destroy(myCorotine);
    }
コード例 #11
0
 protected override void ImmediateReaction()
 {
     if (condition.satisfied)
     {
         trueReaction.InitAndReact();
     }
     else
     {
         falseReaction.InitAndReact();
     }
 }
コード例 #12
0
    IEnumerator CheckForGiving()
    {
        FSLocator.textDisplayer.HideDialogueHolder();
        FSLocator.characterDisplayer.HideImage();

        // 인벤토리 간 조작 금지 설정
        FSLocator.textDisplayer.reactionButton.gameObject.SetActive(false);

        // "주다" 버튼이 포함되어 있는 인벤토리 UI 표시
        inventory.OnClickGive(npcName);
        inventory.isSimpleGive = false;

        // 사용자가 아이템 선택 후 "주다" 버튼 클릭까지 대기
        while (inventory.giveBg.activeSelf)
        {
            yield return(null);
        }

        // 인벤토리 간 조작 금지 설정 해제
        //FSLocator.textDisplayer.reactionButton.enabled = true;

        // 클릭한 slot 아이템의 이름과 infoList 내의 아이템 이름 중 맞는 게 있다면..
        for (int i = 0; i < infoList.Count; i++)
        {
            if (infoList[i].itemName == inventory.itemName.text)
            {
                // 클릭한 slot의 물건 삭제, condition 체크 수행
                //inventory.Give_OnCondition();
                // 2018-11-10 수정 : 준 아이템에 따른 리액션리스트에서 전달한 아이템을 삭제
                inventory.isGive = true;

                // 해당 아이템을 주었을 때의 reaction 실행
                infoList[i].reactionCollection.InitAndReact();
                break;
            }
        }

        // 주려는 물건이 지정돤 물건이 아니라면..
        if (inventory.isGive == false)
        {
            notGivedReaction.InitAndReact();
        }

        inventory.isGive       = false;
        inventory.isSimpleGive = true;

        // 인벤토리 간 조작 금지 해제
        FSLocator.textDisplayer.reactionButton.gameObject.SetActive(true);

        Destroy(myCorotine);
    }
コード例 #13
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        // 플레이어를 잡으면..
        if (collision.tag == "Player")
        {
            // 따라다니는걸 멈추고..
            transform.parent.GetComponent <FollowTarget>().enabled = false;
            transform.parent.GetComponent <PolyNavAgent>().Stop();
            transform.parent.GetComponent <Rigidbody2D>().velocity = Vector2.zero;

            // Ending Reaction 호출
            endReacitonCollection.InitAndReact();
        }
    }
コード例 #14
0
    public void FailedPuzzle()
    {
        failedCount++;

        switch (failedCount)
        {
        case 1:
            firstFailedReaction.InitAndReact();
            break;

        case 2:
            failedCount = 0;
            secondFailedReaction.InitAndReact();
            break;
        }
    }
コード例 #15
0
    // 아이템(문서) 획득 Panel 제거
    public void OnClickExitOnGettingPanel()
    {
        // 클릭 효과음 출력
        audioSource.clip = audioClipForClick;
        audioSource.Play();

        // Panel 제거
        gettingItemPanel.SetActive(false);

        // 만약 after 이벤트가 등록되어 있으면 실행
        if (afterReaction != null)
        {
            afterReaction.InitAndReact();
            afterReaction = null;
        }
    }
コード例 #16
0
    IEnumerator Timer()
    {
        while (isFinished == false)
        {
            // 0초..
            if (secondFloat == 0)
            {
                // 0분, 즉 시간이 모두 끝남
                if (minuteFloat == 0)
                {
                    isFinished = true;

                    failedReaction.InitAndReact();

                    // 종료
                    Debug.Log("Finish");
                }
                else
                {
                    // 1초 대기
                    yield return(new WaitForSeconds(1));

                    // 1분 삭감
                    minuteFloat--;
                    // 59초로 다시 셋팅
                    secondFloat = 59;

                    // 출력
                    minute.text = string.Format("{0:00}", minuteFloat);
                    second.text = string.Format("{0:00}", secondFloat);
                }
            }
            else
            {
                // 1초 대기
                yield return(new WaitForSeconds(1));

                // 1초 삭감
                secondFloat--;

                // 출력
                second.text = string.Format("{0:00}", secondFloat);
            }
            yield return(null);
        }
    }
コード例 #17
0
    IEnumerator Wating()
    {
        MissionScript mission = GameObject.FindObjectOfType <MissionScript>();

        mission.isClicked = false;

        while (true)
        {
            yield return(null);

            if (mission.isClicked == true)
            {
                afterReaction.InitAndReact();
                break;
            }
        }

        Destroy(myCorotine);
    }
コード例 #18
0
    // Use this for initialization
    void Start()
    {
        if ((1920 * Screen.height / Screen.width) > 1080)
        {
            CanvasScaler[] canvases = GameObject.FindObjectsOfType <CanvasScaler>();
            for (int i = 0; i < canvases.Length; i++)
            {
                canvases[i].referenceResolution = new Vector2(1920, 1920 * Screen.height / Screen.width);
            }
        }

        // Load / Save를 위한 script 캐싱
        saveData = FindObjectOfType <SaveDataSystem>();

        // 현재 사용하는 slot 정보를 가져온다.
        int usingSlotCount = StaticInfoForSound.playingSlotIndex;

        // 메인 씬에서 불러오기를 선택했다면..
        if (usingSlotCount != 4)
        {
            // 이전 데이터를 불러온다.
            saveData.LoadData(usingSlotCount);

            // 이전 데이터로 현재 데이터를 변경한다.
            LoadData();

            // 게임 시작.
            defaultReactionCollection.InitAndReact();
        }
        else
        {
            StaticInfoForSound.con_BGM_Audio = GameObject.Find("BGMSound_Main").GetComponent <AudioSource>();

            // 튜토리얼 시작
            tutorialReactionCollection.InitAndReact();
        }
    }
コード例 #19
0
 protected override void ImmediateReaction()
 {
     //TutorialController.Instance.reactionButton.onClick.RemoveAllListeners();
     //TutorialController.Instance.reactionButton.onClick.AddListener(delegate { newReactionCollection.React(); });
     newReactionCollection.InitAndReact();
 }
コード例 #20
0
 public void SubQuestReaction()
 {
     subQuestReaction.InitAndReact();
 }
コード例 #21
0
 public void ClearPuzzle()
 {
     clearReaction.InitAndReact();
 }
コード例 #22
0
 public void OnClickWatch()
 {
     clickReaction.InitAndReact();
 }
コード例 #23
0
 public void OnClickReturn()
 {
     backReaction.InitAndReact();
 }