Esempio n. 1
0
    //check if input value has edit, return values that true or false or nonmatched
    public void ActByInputValue()
    {
        for (int i = 0; i < curContent.input.options.Length; i++)
        {
            if (curContent.input.options[i].keyword == choosedInput)
            {
                choosedOptionIndex = i;
                Debug.Log("matched this option" + curContent.input.options[i].keyword);
                curInputResult = InputResultState.match;
                break;
            }
            else
            {
                curInputResult = InputResultState.nonMatch;
                if (curContent.input.options[i].keyword == "nonMatched")
                {
                    nonMatchedInputActionIndex = i;
                    Debug.Log("nonmatch index" + curContent.input.options[i].action.gotoContent);
                    break;
                }
            }
        }

        //act by input value
        switch (curInputResult)
        {
        case InputResultState.match:

            Debug.Log("match this --> " + curContent.input.options[choosedOptionIndex].keyword);
            //go actions
            ActByActionType(curContent.input.options[choosedOptionIndex].type, curContent.input.options[choosedOptionIndex].action);

            break;

        case InputResultState.nonMatch:
            Debug.Log("어떤 형태로도 맞지 않는다.--> " + curContent.input.options[nonMatchedInputActionIndex].keyword);
            ActByActionType(curContent.input.options[nonMatchedInputActionIndex].type, curContent.input.options[nonMatchedInputActionIndex].action);

            break;

        case InputResultState.empty:
            Debug.LogError("Input result is empty , check Json keyword is right ");
            break;
        }

        curContentIndex++;
        //sssssss
        curDialogState = DialogState.playDialog;
    }
Esempio n. 2
0
    public void LoadNextContentList(int dialogindex)
    {
        if (dialogindex >= DataSorter.instance.curDialogs.Length)
        {
            Debug.Log("sequence is end");
            curDialogState = DialogState.endDialog;
        }
        else
        {
            curContentIndex = 0;
            Debug.Log("curContentIndex is zero->" + curContentIndex);
            //content index
            curOrderIndex  = 0;
            curInputResult = InputResultState.empty;
            curDialogState = DialogState.waitTrigger;
            curTime        = 0;

            curContent = DataSorter.instance.curContentList[curOrderIndex];

            inputPannel.SetActive(false);
        }
    }
Esempio n. 3
0
    private void OnEnable()
    {
        bubbleGenerator = this.GetComponent <BubleGenerator>();
        curInputResult  = InputResultState.empty;
        curDialogState  = DialogState.waitTrigger;
        ui_inputField   = inputPannel.GetComponentInChildren <Buble>();
        inputPannel.SetActive(false);
        tabmanager    = tabManager;
        a_sources     = audioPlayer.GetComponentsInChildren <AudioSource>();
        ARContentOnId = new string[2];

        for (int i = 0; i < ARContentOnId.Length; i++)
        {
            ARContentOnId[i] = "null";
        }

        VuforiaRuntime.Instance.InitVuforia();
        //init vuforia

        //get bundle
        for (int i = 0; i < DataSorter.instance.List_bundle.Count; i++)
        {
            for (int j = 0; j < list_ArContent.Length; j++)
            {
                if (list_ArContent[j].myArId == DataSorter.instance.List_bundle[i].name)
                {
                    GameObject arBundles = Instantiate(DataSorter.instance.List_bundle[i].loadObject);
                    arBundles.transform.parent        = list_ArContent[i].transform.GetChild(0);
                    arBundles.transform.localPosition = Vector3.zero;
                    arBundles.transform.localRotation = Quaternion.identity;
                    arBundles.transform.localScale    = Vector3.one;
                    Debug.Log("budle" + list_ArContent[i].myArId + " - is loaded on scene");
                }
            }
        }
        contentTypingEnd = true;
    }