コード例 #1
0
ファイル: Submenu1.cs プロジェクト: 1264109842/Sight-City
 //private DynamicRooms dr = new DynamicRooms();
 void Start()
 {
     EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);
     //Debug.Log (floorPick());
     introToCurrentMenu();
     rlc = new RoomLocationsConf();
 }
コード例 #2
0
    void Start()
    {
        EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);

        string path = Application.persistentDataPath + "/LevleSave.json";

        string jsonString = File.ReadAllText(path);

        Debug.Log(jsonString);
        json = (JSONNode)JSON.Parse(jsonString);

        gameController = gameObject.GetComponent <GameController1> ();
        Button one     = levelOne.GetComponent <Button> ();
        Button two     = levelTwo.GetComponent <Button> ();
        Button three   = levelThree.GetComponent <Button> ();
        Button four    = levelFour.GetComponent <Button> ();
        Text   lvone   = numLevelOne.GetComponent <Text> ();
        Text   lvtwo   = numLevelTwo.GetComponent <Text> ();
        Text   lvthree = numLevelThree.GetComponent <Text> ();
        Text   lvfour  = numLevelFour.GetComponent <Text> ();


        print(json ["Level One"] ["End"].Count + ".");

        lvone.text   = json ["Level One"] ["End"].Count + ".";
        lvtwo.text   = json ["Level two"] ["End"].Count + ".";
        lvthree.text = json ["Level three"] ["End"].Count + ".";
        lvfour.text  = json ["Level four"] ["End"].Count + ".";

        inforBrg  = new TheInformationBridge();
        selection = 0;


        isGenerate = true;


        /*string path = Application.persistentDataPath + "/LevleSave.json";
         *
         * string jsonString = File.ReadAllText (path);
         * Debug.Log (jsonString);
         * json = (JSONNode)JSON.Parse (jsonString);*/
        roomLoc = new RoomLocationsConf();


        one.onClick.AddListener(ClickOne);
        two.onClick.AddListener(ClickTwo);
        three.onClick.AddListener(ClickThree);
        four.onClick.AddListener(ClickFour);
    }
コード例 #3
0
    // Use this for initialization
    void Awake()
    {
        Application.targetFrameRate = 77;
        QualitySettings.vSyncCount  = 0;

        // Initialize the player
        EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);               // text to speech
        //EasyTTSUtil.OpenTTSSetting ();
        //playerRigidbody = GetComponent<Rigidbody>();
        infoBrg = new TheInformationBridge();
        agent   = GetComponent <NavMeshAgent> ();
        source  = GetComponent <AudioSource> ();
        rlc     = new RoomLocationsConf();

        playerStartingPoint = rlc.setStartingPoint();
        start = "0,0,0";
        //"Not defined yet";
        end = "0,0,0";
        //"Not defined yet";

        colTime        = Time.timeSinceLevelLoad;
        myCols         = new ArrayList();
        countColli     = 0;
        countWrongStep = 0;
        endOfGame      = false;
        isMoving       = false;
        interTime      = 1.0f;
        restartTime    = 0.0f;
        instruct       = "";
        nearBy         = "";
        nearByQueue    = new string[3];
        source.clip    = footSteps;
        source.volume  = 1f;
        firstTimeHit   = 0;

        correctDirection = "";
        accessDirection  = "";
        isAllowMove      = true;
        isReachTarget    = false;
        trackPosition    = new string[2];
        justTurned       = false;
        frameCount       = 1;

        if (collisionText != null)
        {
            collisionText.text = "Collision count: " + countColli.ToString();
        }
    }
コード例 #4
0
    // Use this for initialization
    void Start()
    {
        EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);

        nextDir       = new NextDirection();
        rlc           = new RoomLocationsConf();
        infoBrg       = new TheInformationBridge();
        curVal        = 0;
        startPoint    = new Vector3(151.3f, 2f, -137.1f); //rlc.setStartingPoint ();
        endPoint      = new Vector3(52f, 2f, 17f);        //rlc.setEndingPoint ();
        agent.enabled = false;
        isFeet        = false;

        player.transform.position = startPoint;
        //Debug.Log (player.position+"********************");
        //player.transform.rotation = ;
        nextDir.setStart(startPoint);
        target.transform.position = endPoint;

        agent.enabled = true;


        //isTutored = false;
        instructMode = 0;
        path         = agent.path;

        //nextDirection = "";
        crntDirection = "";
        fourDir       = " ";

        //degree = 0;           No longer used to get next direction to way point

        calculatePath();
        isFirstTime = true;
        adjustDirection();
        numWayPoint = path.corners.Length;
        elapsed     = 0;

        curMsg              = "constantly redefined";
        difMsg              = "redefined only is curmsg changes";
        moveTurnInstruct    = 1;
        moveTurnInstructEnd = false;
        //Debug.Log (player.position+"++++++++");
        //for (int i = 0; i < path.corners.Length; i++)
        //Debug.Log (path.corners[i]);
        totalDistance();
    }
コード例 #5
0
    // Use this for initialization
    void Start()
    {
        infoBrg = new TheInformationBridge();
        mode    = infoBrg.getTutorialMode();
        EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);

        nextDir       = new NextDirection();
        rlc           = new RoomLocationsConf();
        infoBrg       = new TheInformationBridge();
        curVal        = 0;
        startPoint    = new Vector3(50.4f, 2f, -50.7f);
        endPoint      = new Vector3(50f, 2f, 38.2f);
        agent.enabled = false;
        isFeet        = false;

        //player.transform.position = startPoint;
        //Debug.Log (player.position+"********************");
        //player.transform.rotation = ;
        nextDir.setStart(startPoint);
        target.transform.position = endPoint;

        agent.enabled = true;
        //mode = infoBrg.getTutorialMode ();


        path = agent.path;

        //nextDirection = "";
        crntDirection = "";
        fourDir       = " ";

        //degree = 0;           No longer used to get next direction to way point

        if (!infoBrg.getReachTarget())
        {
            calculatePath();
        }
        numWayPoint = path.corners.Length;
        elapsed     = 0;

        curMsg = "constantly redefined";
        difMsg = "redefined only is curmsg changes";
        //Debug.Log (player.position+"++++++++");
        //for (int i = 0; i < path.corners.Length; i++)
        //Debug.Log (path.corners[i]);
        //adjustDirection ();
    }
コード例 #6
0
    void Start()
    {
        EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);
        gameController = gameObject.GetComponent <GameController1> ();
        Button gT      = generalTutorial.GetComponent <Button> ();
        Button tT      = trainingTutorial.GetComponent <Button> ();
        Button tM      = trainingMode.GetComponent <Button> ();
        Button gM      = gameMode.GetComponent <Button> ();
        Button calPath = CalculatPath.GetComponent <Button> ();

        selection = 0;
        inforBrg  = new TheInformationBridge();
        roomLoc   = new RoomLocationsConf();



        gT.onClick.AddListener(ClickGeneralTutorial);
        tT.onClick.AddListener(ClickTrainingTutorial);
        tM.onClick.AddListener(ClickTrainingMode);
        gM.onClick.AddListener(ClickGameMode);
        calPath.onClick.AddListener(ClickCalPath);
    }
コード例 #7
0
    // Use this for initialization
    void Start()
    {
        EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);

        nextDir       = new NextDirection();
        rlc           = new RoomLocationsConf();
        infoBrg       = new TheInformationBridge();
        curVal        = 0;
        startPoint    = rlc.setStartingPoint();
        endPoint      = rlc.setEndingPoint();
        agent.enabled = false;
        isFeet        = false;

        player.transform.position = rlc.setStartingPoint();
        //Debug.Log (player.position+"********************");
        //player.transform.rotation = ;
        nextDir.setStart(rlc.setStartingPoint());
        target.transform.position = rlc.setEndingPoint();

        agent.enabled = true;


        path = agent.path;

        //nextDirection = "";
        crntDirection = "";
        fourDir       = " ";

        //degree = 0;           No longer used to get next direction to way point

        numWayPoint = path.corners.Length;
        elapsed     = 0;

        isAutoGerneratePath = infoBrg.getAutoGenerateStates();
        if (isAutoGerneratePath)
        {
            SaveJson();
        }
        curMsg = "constantly redefined";
        difMsg = "redefined only is curmsg changes";
        //Debug.Log (player.position+"++++++++");
        //for (int i = 0; i < path.corners.Length; i++)
        //Debug.Log (path.corners[i]);
        calculatePath();
        adjustDirection();
        summary();


        /*
         * if (isAutoGerneratePath) {
         *      if (rooms == null)
         *              rooms = GameObject.FindGameObjectsWithTag ("Door");
         *      //Debug.Log (rooms.Length);
         *      roomPosition = new Vector3[rooms.Length];
         *      int i = 0;
         *      foreach (GameObject room in rooms) {
         *              roomPosition [i] = new Vector3(room.transform.position.x, 2f, room.transform.position.z);
         *              Debug.Log (roomPosition[i]);
         *              i++;
         *      }
         *
         *
         *      Vector3[] a = new Vector3[2];
         *      for(int j = 0; j < roomPosition.Length; j++){
         *              for(int k = 0; k < roomPosition.Length; k++){
         *                      if(j != k){
         *                              Debug.Log ("start: " + roomPosition[j] + "End: " + roomPosition[k]);
         *
         *                              Debug.Log (totalRoomPassedBy (roomPosition[j],roomPosition[k]) + " rooms pass by. "
         + totalPossibleTurn (roomPosition[j],roomPosition[k]) + " turns include."
         + DifficultWeight (roomPosition[j],roomPosition[k]) + " turn weight."
         + totalDistance(roomPosition[j],roomPosition[k]) + " Distance."
         + (totalRoomPassedBy (roomPosition[j],roomPosition[k]) * 2 + totalPossibleTurn (roomPosition[j],roomPosition[k])* 2
         + DifficultWeight (roomPosition[j],roomPosition[k]) * 10 + totalDistance(roomPosition[j],roomPosition[k])*0.1) + " DIfficutly.");
         +
         +                              difficulty = totalRoomPassedBy(roomPosition[j],roomPosition[k]) * 2
         + totalPossibleTurn(roomPosition[j],roomPosition[k]) * 2
         + DifficultWeight(roomPosition[j],roomPosition[k]) * 10
         + (totalDistance(roomPosition[j],roomPosition[k]) * 0.1);
         +
         +                              //Debug.Log (difficulty);
         +                              if(difficulty < 20 && difficulty >= 0){
         +                                      Debug.Log ("add success");
         +                                      levelOne.Add(a);
         +                                      //Debug.Log ("add success");
         +                              }
         +                              if(difficulty < 50 && difficulty >= 20){
         +                                      levelTwo.Add(a);
         +                              }
         +                              if(difficulty < 80 && difficulty >= 50){
         +                                      levelThree.Add(a);
         +                              }
         +                              if(difficulty >= 80){
         +                                      levelFour.Add(a);
         +                              }
         +
         +                      }
         +
         +              }
         +      }
         +      //json.Add ("Level one", levelOne.ToArray());
         +
         +      //Debug.Log(levelOne);
         +
         +      //for (int j = 0; j < roomPosition.Length; j++)
         +      //Debug.Log (roomPosition[j]);
         + }*/
    }
コード例 #8
0
    void Start()
    {
        EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);

        gameController = gameObject.GetComponent <GameController1> ();
        Button one     = levelOne.GetComponent <Button> ();
        Button two     = levelTwo.GetComponent <Button> ();
        Button three   = levelThree.GetComponent <Button> ();
        Button four    = levelFour.GetComponent <Button> ();
        Button confirm = confirmButton.GetComponent <Button> ();
        Button back    = backButton.GetComponent <Button>();
        Text   lvone   = numLevelOne.GetComponent <Text> ();
        Text   lvtwo   = numLevelTwo.GetComponent <Text> ();
        Text   lvthree = numLevelThree.GetComponent <Text> ();
        Text   lvfour  = numLevelFour.GetComponent <Text> ();


        inforBrg  = new TheInformationBridge();
        selection = 0;



        /*string path = Application.persistentDataPath + "/LevleSave.json";
         *
         * string jsonString = File.ReadAllText (path);
         * Debug.Log (jsonString);
         * json = (JSONNode)JSON.Parse (jsonString);*/
        roomLoc = new RoomLocationsConf();

        try
        {
            //EasyTTSUtil.SpeechAdd("try to catch the exception");
            inforBrg.setAutoGenerateStates(false);
            string path = Application.persistentDataPath + "/LevleSave.json";
            //EasyTTSUtil.SpeechAdd("one");
            string jsonString = "";
            //if (platform == RuntimePlatform.WindowsEditor || platform == RuntimePlatform.WindowsPlayer)
            jsonString = File.ReadAllText(path);

            /*if (platform == RuntimePlatform.OSXEditor || platform == RuntimePlatform.OSXPlayer)
             *      jsonString = File.ReadAllText (path);
             * if (platform == RuntimePlatform.Android || platform == RuntimePlatform.IPhonePlayer){
             *      TextAsset jsonTxt = (TextAsset)Resources.Load("LevleSave",typeof(JSON));
             *      jsonString = jsonTxt.text;
             * }*/
            //EasyTTSUtil.SpeechAdd("two");
            //Debug.Log (jsonString);
            json = (JSONNode)JSON.Parse(jsonString);

            print(json ["Level One"] ["End"].Count + ".");

            lvone.text   = json ["Level One"] ["End"].Count + ".";
            lvtwo.text   = json ["Level two"] ["End"].Count + ".";
            lvthree.text = json ["Level three"] ["End"].Count + ".";
            lvfour.text  = json ["Level four"] ["End"].Count + ".";
        }catch (FileNotFoundException e)
        {
            //EasyTTSUtil.SpeechAdd("catch the exceptoption");
            inforBrg.setAutoGenerateStates(true);
            roomLoc.getStartingPoint(new Vector3(44f, 2f, 138.7f));
            roomLoc.getEndingPoint(new Vector3(44f, 2f, 138.7f));
            Application.LoadLevel("CCNYGrove");
        }



        selectNum.onEndEdit.AddListener(SelectNumber);
        one.onClick.AddListener(ClickOne);
        two.onClick.AddListener(ClickTwo);
        three.onClick.AddListener(ClickThree);
        four.onClick.AddListener(ClickFour);
        confirm.onClick.AddListener(Confirm);
        back.onClick.AddListener(ClickBack);
    }