Exemple #1
0
    private IEnumerator SixtySecUpdate()
    {
        while (true)
        {
            yield return(new WaitForSeconds(60)); // wait

            GameController1.ReCheckWhatsOnStorage();
        }
    }
Exemple #2
0
 private void Awake()
 {
     playerText      = transform.Find("PlayerText").GetComponent <TextMesh>();
     playerRB        = gameObject.GetComponent <Rigidbody2D>();
     gamecontroller1 = GameObject.Find("GameController").GetComponent <GameController1>();
     playerAnimator  = transform.Find("PlayerSprite").GetComponent <Animator>();
     playerSprite    = transform.Find("PlayerSprite").GetComponent <SpriteRenderer>();
     tmp             = new Color(playerSprite.color.r, playerSprite.color.g, playerSprite.color.b, 0.25f);
     norm            = playerSprite.color;
     thisAudiosource = gameObject.GetComponent <AudioSource>();
 }
 // SINGLETON of this class
 void MakeSingleton()
 {
     if (instance != null)
     {
         Destroy(this.gameObject);
     }
     else
     {
         instance = this;
         DontDestroyOnLoad(this.gameObject);
     }
 }
 // Use this for initialization
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(instance);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Exemple #5
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);
    }
Exemple #6
0
    void Start()
    {
        EasyTTSUtil.Initialize(EasyTTSUtil.UnitedStates);
        gameController = gameObject.GetComponent <GameController1> ();
        Button yes = yesButton.GetComponent <Button> ();
        Button no  = NoButton.GetComponent <Button> ();

        selection = 0;
        inforBrg  = new TheInformationBridge();
        inforBrg.setReachTarget(false);

        EasyTTSUtil.SpeechAdd("Do you want play again");
        Debug.Log("DO you want play again?");
        yes.onClick.AddListener(ClickYes);
        no.onClick.AddListener(ClickNo);
    }
Exemple #7
0
    private IEnumerator OneSecUpdate()
    {
        while (true)
        {
            yield return(new WaitForSeconds(1)); // wait

            GameController1.UpdateOneSecond();
            DataController.Update();

            HUDFPS.Message = " | " + MouseInBorderRTS.GlobalDir.ToString() + "| Dragged: " + Way._dir +
                             " | InputMode: " + BuildingPot.InputMode + "\n" + more + "\n"
                             + AddPersonControllerInfo() + " | " + AddLoadingInfo()
                             //  +               Pull AddUnityStats()
                             + AddCachedReoutesCount();
        }
    }
Exemple #8
0
    // Use this for initialization
    private void Start()
    {
        if (Developer.IsDev)
        {
            GameSpeed = 0;
        }

        Debug.Log("GameScene Start():" + Time.time);

        Book.Start();

        if (HType == H.Create)
        {
            LoadTerrain();
        }

        GameController1.Start();
        StartCoroutine("SixtySecUpdate");
        StartCoroutine("OneSecUpdate");

        textMessage               = (Btn3D)General.Create(Root.menusTextMiddle, new Vector3(0.85f, 0.3f, 0));
        textMessage.MoveSpeed     = 40f; //so fade happens
        textMessage.FadeDirection = "FadeIn";

        dummyBlue = General.Create(Root.blueCubeBig, new Vector3());
        dummyRed  = General.Create(Root.redCube, new Vector3());

        createDummySpawn = true;

        dummySpawnPoint = (Structure)Building.CreateBuild(Root.dummyBuildWithSpawnPointUnTimed, new Vector3(), H.Dummy,
                                                          container: Program.ClassContainer.transform);

        //hudColor = textMessage.GetComponent<GUIText>().color;

        ProgramDataInit();

        if (GameTimePeople == null)
        {
            GameTimePeople = new GameTime(ModController.PeopleAgeFactor());
        }

        _unitsManager = FindObjectOfType <UnitsManager>();
        _enemyManager = FindObjectOfType <EnemyManager>();
        Debug.Log("GameScene Start():" + Time.time);
    }
Exemple #9
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);
    }
 void Awake()
 {
     instance = this;
 }
Exemple #11
0
 // Use this for initialization
 void Start()
 {
     gameController1 = FindObjectOfType <GameController1>();
 }
Exemple #12
0
 private void Start()
 {
     gm = GameObject.FindGameObjectWithTag("GM").GetComponent <GameController1>();
 }
Exemple #13
0
 // Use this for initialization
 void Start()
 {
     gm = GameObject.FindGameObjectWithTag("GM").GetComponent <GameController1>();
     transform.position = gm.lastCheckPointPos;
 }
Exemple #14
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);
    }
 void Awake()
 {
     instance = this;
 }
    void Start()
    {
        if (cam == null) {
            cam = Camera.main;
        }
        instace = this;
        //creating list of all objects
        Alphabets.Add (GameObject.FindGameObjectWithTag ("apple"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("banana"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("brinjal"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("carrot"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("coconut"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("grapes"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("guava"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("lemon"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("litchi"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("mango"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("mushroom"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("onion"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("orange"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("papaya"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("peach"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("pear"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("peas"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("pineapple"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("potato"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("strawberry"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("tomato"));

        Alphabets.Add (GameObject.FindGameObjectWithTag ("buffalo"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("camel"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("cat"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("cow"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("crane"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("crow"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("dog"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("donkey"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("duck"));
        Alphabets.Add (GameObject.FindGameObjectWithTag ("elephant"));

        Vector3 upperCorner = new Vector3 (Screen.width, Screen.height, 0.0f);
        Vector3 targetWidth = cam.ScreenToWorldPoint (upperCorner);
        maxWidth = targetWidth.x;

        StartCoroutine(Spawn());
    }