Esempio n. 1
0
    // 이건 굳이 이렇게 안하고 특정 판넬이 켜져있으면 switch문으로 해도 될 듯
    public void LoadJson(string ItemStage)
    {
        if (ItemNumber >= 0 && ItemStage != "")
        {
            data     = Resources.Load <TextAsset>(ItemStage + "/" + ItemStage);
            ItemData = JsonMapper.ToObject(data.text);

            ImageString = ItemData["Item"][ItemNumber]["Item_Image"].ToString();
            Itemname    = ItemData["Item"][ItemNumber]["Item_Name"].ToString();
            if (transform.Find("1_ObjectSet").transform.childCount >= 0 &&
                transform.Find("2_Grid").transform.childCount <= 10)
            {
                obj = Instantiate(ItemClone, Vector3.zero, Quaternion.identity) as GameObject;
                obj.transform.SetParent(transform.Find("1_ObjectSet").transform);
                obj.transform.localScale = Vector3.one;
                obj.transform.name       = ItemNumber.ToString() + "-" + ImageString;
            }
            obj.GetComponent <Image>().sprite = Resources.Load <Sprite>(ItemStage + "/" + ImageString);
            obj.GetComponent <Image>().color  = new Color(obj.GetComponent <Image>().color.r, obj.GetComponent <Image>().color.g, obj.GetComponent <Image>().color.b, 255);

            obj.transform.SetParent(transform.Find("2_Grid").transform);

            At.SetMember(Itemname, ItemStage + "/" + ImageString);

            if (!isSpecial)
            {
                At.PopUp();
            }
        }
    }
Esempio n. 2
0
    void ChangeSettings()
    {
        if (KeyWordMode)
        {
            if (currentIndex == End_of_Line)
            {
                KWcontrol.KeyWordControl.SetActive(true);
                KWcontrol.Updatastatus();
                keywordrunning = false;
                //return;
            }
            else
            {
                asd();

                scriptstring   = ConvertedData["dialogues"][currentIndex]["script_Text"].ToString();
                Name_Text.text = ConvertedData["dialogues"][currentIndex]["character_name"].ToString();

                if (ConvertedData["dialogues"][currentIndex]["standImage_left_Name"] != null)
                {
                    imagestring_left        = ConvertedData["dialogues"][currentIndex]["standImage_left_Name"].ToString();
                    Stand_Image_Left.sprite = Resources.Load <Sprite>("StandImage/" + imagestring_left);
                }
                else
                {
                    Stand_Image_Left.sprite = Resources.Load <Sprite>("StandImage/Nothing");
                }

                if (ConvertedData["dialogues"][currentIndex]["standImage_right_Name"] != null)
                {
                    imagestring_right        = ConvertedData["dialogues"][currentIndex]["standImage_right_Name"].ToString();
                    Stand_Image_Right.sprite = Resources.Load <Sprite>("StandImage/" + imagestring_right);
                }
                else
                {
                    Stand_Image_Right.sprite = Resources.Load <Sprite>("StandImage/Nothing");
                }
                isScriptEnd = false;

                CoroutineforText = TextAnimation(0.01f);
                StartCoroutine(CoroutineforText);
                currentIndex++;                              //다음대사로
            }
        }
        else
        {
            if (currentIndex == End_of_Line)
            {
                currentIndex = 0;
                isActive     = false;

                EM.Doing_Event = false;
                Empty.SetActive(false);
                if (is_event_plus)
                {
                    EM.Event_Number++;
                }
                SetChat.gameObject.SetActive(false);
                TextForAnmiate     = "";
                Dialogue_Text.text = "";
                Name_Text.text     = "";
                currentIndex       = 0;
                cntForAnimate      = 0;
                if (isSpecial)
                {
                    Debug.Log(At.ItemName_String);
                    At.PopUp();
                }
                StopAllCoroutines();
                return;
            }
            asd();

            scriptstring   = ConvertedData["dialogues"][currentIndex]["script_Text"].ToString();
            Name_Text.text = ConvertedData["dialogues"][currentIndex]["character_name"].ToString();

            if (ConvertedData["dialogues"][currentIndex]["standImage_left_Name"] != null)
            {
                imagestring_left        = ConvertedData["dialogues"][currentIndex]["standImage_left_Name"].ToString();
                Stand_Image_Left.sprite = Resources.Load <Sprite>("StandImage/" + imagestring_left);
            }
            else
            {
                Stand_Image_Left.sprite = Resources.Load <Sprite>("StandImage/Nothing");
            }

            if (ConvertedData["dialogues"][currentIndex]["standImage_right_Name"] != null)
            {
                imagestring_right        = ConvertedData["dialogues"][currentIndex]["standImage_right_Name"].ToString();
                Stand_Image_Right.sprite = Resources.Load <Sprite>("StandImage/" + imagestring_right);
            }
            else
            {
                Stand_Image_Right.sprite = Resources.Load <Sprite>("StandImage/Nothing");
            }

            isScriptEnd = false;

            CoroutineforText = TextAnimation(0.01f);
            StartCoroutine(CoroutineforText);
            currentIndex++;                              //다음대사로
        }
    }