示例#1
0
    void InterpretSequence()
    {
        if (currentSequence >= currentChain[currentLink].sequences.Length)
        {
            return;
        }

        string para = currentChain[currentLink].sequences[currentSequence].parameter;

        switch (currentChain[currentLink].sequences[currentSequence].type)
        {
        case SequenceType.DIALOGUE:
            map.SetActive(false);
            ActivateDialogue(int.Parse(para));
            break;

        case SequenceType.BATTLE:
            map.SetActive(false);
            camScript.ActivateBattleCam();
            board = (GameObject)Instantiate(Resources.Load("Boards/" + para));
            //combat.SetActive(true);
            //battleUI.SetActive(true);
            //battleUI.SetActive(true);
            ProjectileScript ps = GameObject.FindGameObjectWithTag("ProjectileController").GetComponent <ProjectileScript>();
            ps.Reset();

            /*foreach (GameObject i in GameObject.FindGameObjectsWithTag("Board"))
             *  if (i.name == para)
             *  {
             *      for (int j = 0; j < i.transform.childCount; j++)
             *          i.transform.GetChild(j).gameObject.SetActive(true);
             *      UnityEditor.PrefabUtility.ResetToPrefabState(i.transform.GetChild(0));
             *  }
             */
            break;

        case SequenceType.ACTIVATE_NODE:
            mapScript.OpenCity(int.Parse(para));
            NextSequence();
            break;

        case SequenceType.MUSIC:
            audioCS.PlayMusic(para);
            NextSequence();
            break;

        case SequenceType.BACKGROUND:
            bgName = para;
            NextSequence();
            break;
        }
    }
示例#2
0
    //Executes given text command
    void ExecuteTxtCommand(string[] command)
    {
        switch (command[0])
        {
        //SET PORTRAIT IMAGES
        case ("LPort"): LoadPortraitImage(leftPortrait, command[1], ref lPortPos, lDefaultPos, 1);
            break;

        case ("RPort"): LoadPortraitImage(rightPortrait, command[1], ref rPortPos, rDefaultPos, -1);
            break;

        //SET NAME TAGS
        case ("LName"):
            leftNameTag.SetActive(true);
            leftNameTag.transform.GetChild(0).GetComponent <Text>().text = command[1];
            break;

        case ("RName"):
            rightNameTag.SetActive(true);
            rightNameTag.transform.GetChild(0).GetComponent <Text>().text = command[1];
            break;

        //SET SPEAKING STATE
        case ("LSpeaking"):
            if (command[1] == "T")
            {
                setCharSpeaker(leftPortrait, leftNameTag);
            }
            else
            {
                setCharListener(leftPortrait, leftNameTag);
            }
            break;

        case ("RSpeaking"):
            if (command[1] == "T")
            {
                setCharSpeaker(rightPortrait, rightNameTag);
            }
            else
            {
                setCharListener(rightPortrait, rightNameTag);
            }
            break;

        case ("Anim"):
            ExecuteAnim(command[1]);
            break;

        case ("Music"):
            audioCS.PlayMusic(command[1]);
            break;

        case ("BG"):
            SetBackground(command[1]);
            break;

        case ("Item"):
            ShowItem(command[1]);
            break;

        case ("Clear"):
            ClearActors();
            break;

        default:
            break;
        }
    }