Пример #1
0
 // Use this for initialization
 void Start()
 {
     timer        = 0;
     totalScore   = 0;
     finalScore   = 0;
     hsController = GameObject.FindObjectOfType <HSController> ();
     levelManager = GameObject.FindObjectOfType <LevelManager> ();
 }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     gameover   = false;
     posted     = false;
     read       = false;
     scor       = 0;
     namePlayer = PlayerPrefs.GetString("name");
     hs         = gameObject.GetComponent <HSController>();
 }
Пример #3
0
    private void SubmitName(string username)
    {
        int          distance = PlayerPrefs.GetInt("Distance");
        int          bananas  = PlayerPrefs.GetInt("Bananas");
        int          score    = 60 * distance + 40 * bananas;
        HSController HS       = new HSController();

        StartCoroutine(HS.PostScores(username, score, distance, bananas));
        StartCoroutine(HS.GetScores());
    }
Пример #4
0
 void Start()
 {
     hsController = GetComponent <HSController>();
     StartCoroutine(hsController.GetScores());
     playerScoreText.text = "" + Player.finalScore;
     if (MainMenu.comingFromMenu)
     {
         restartButton.gameObject.SetActive(false);
     }
 }
Пример #5
0
	void Awake(){
		checkLevel ();
		checkStreak ();
		checkScore ();
		acquiredAchievements = getAchievements ();
		splitAchievements ();
		achieveAdd = gameObject.GetComponent<HSController>();
		print (SystemInfo.deviceUniqueIdentifier);
		print (status);
		achieveAdd.addAchievement (SystemInfo.deviceUniqueIdentifier, status);

	}
Пример #6
0
 // Use this for initialization
 void Start()
 {
     hsController     = GetComponent <HSController>();
     mSource          = GetComponent <AudioSource>();
     cameraController = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraMovement>();
     sRenderer        = GetComponent <SpriteRenderer>();
     ChangeHumor(null);
     Object[] ressources = Resources.LoadAll("Ingredients", typeof(Ingredient));
     foreach (var t in ressources)
     {
         foodEat.Add(t.name, 0);
     }
 }
Пример #7
0
    void Awake()
    {
        if (inst == null)
        {
            inst = this;
        }

        else if (inst != this)
        {
            Destroy(gameObject);
            return;
        }
    }
Пример #8
0
    // Use this for initialization
    void Start()
    {
        myRigidbody = GetComponent <Rigidbody2D> ();
        // should we create a gamecontroller for that
        cameraCont          = playerCamera.GetComponent <CameraController>();
        pauseCont           = GetComponent <PauseController>();
        platformCont        = platformControllerObject.GetComponent <PlatformController>();
        endPlatform         = FindObjectOfType <EndPlatformController>().gameObject;
        hsMuellerController = GetComponent <HSController>();

        InitiateMenu();
        GlobalstatsIO stats = new GlobalstatsIO();
    }
Пример #9
0
 void Awake()
 {
     DontDestroyOnLoad(gameObject);
     if (instance6 == null)
     {
         instance6 = this;
     }
     else if (instance6 != this)
     {
         Destroy(gameObject);
         return;
     }
 }
Пример #10
0
 void Awake()
 {
     DontDestroyOnLoad(gameObject);
     // If no Player ever existed, we are it.
     if (instance6 == null)
     {
         instance6 = this;
     }
     // If one already exist, it's because it came from another level.
     else if (instance6 != this)
     {
         Destroy(gameObject);
         return;
     }
 }
Пример #11
0
 void Awake()
 {
     DontDestroyOnLoad(gameObject);
     // If no player ever existed, we are it.
     if (instance6 == null)
     {
         instance6 = this;
     }
     // If one already exists, its because it came from another level.
     else if (instance6 != this)
     {
         Destroy(gameObject);
         return;
     }
     if (Application.loadedLevel == 6 && GameObject.FindWithTag("GLOBALTIMER") != null)
     {
         globalTimer = GameObject.FindWithTag("GLOBALTIMER").GetComponent <GLOBALTIMER>();
     }
 }
Пример #12
0
    private IEnumerator OnSetTsp(Dropdown dropdownGraph)
    {
        pageIndex     = 0;
        currGraphName = (dropdownGraph.options[dropdownGraph.value]).text;
        //FillLeaderboard();
        hsMuellerController = GetComponent <HSController>();

        string result = null;

        yield return(hsMuellerController.StartGetScoresCoroutine(currGraphName, 100, value => result = value));

        print("The result was:" + result);
        muellerLeaderboard = new HSMuellerLeaderboard(result);
        currentValues      = new List <LeaderboardEntry>(muellerLeaderboard.Data);
        currentValues.Sort((x, y) => y.Score - x.Score);
        FillMuellerLeaderboard();

        buttonPreviousPage.gameObject.SetActive(false);
        buttonNextPage.gameObject.SetActive(currentValues.Count > leaderboardCells.Count);
    }
Пример #13
0
 void Awake()
 {
     current = this;
 }
Пример #14
0
 // Use this for initialization
 void Start()
 {
     hs = gameObject.GetComponent <HSController>();
     StartCoroutine(hs.GetScores());
 }
Пример #15
0
 // Use this for initialization
 void Start()
 {
     gameover=false;
     posted=false;
     read=false;
     scor=0;
     namePlayer=PlayerPrefs.GetString("name");
     hs = gameObject.GetComponent<HSController>();
 }
Пример #16
0
 void Start()
 {
     _hsController = GameObject.Find("HSController").GetComponent <HSController>();
 }
Пример #17
0
    // Use this for initialization
    void Start()
    {
        HSController HS = new HSController();

        StartCoroutine(HS.GetScores());
    }
Пример #18
0
	// Update is called once per frame
	public void SubmitScore () {
		scorePoster = gameObject.GetComponent<HSController>();
		scorePoster.postScore (playerName, CorrectAnswer.score);
	}
Пример #19
0
	// Use this for initialization
	void Start () {
		scoreGet = gameObject.GetComponent<HSController>();
		scoreGet.getScore ();
	}
Пример #20
0
        public void GameOver()
        {
            StartCoroutine(HSController.PostScores(PrefsManager.GetName(), _score));

            GSAppExampleControl.Instance.LoadScene(ESceneNames.Arena);
        }
Пример #21
0
 // Use this for initialization
 void Start()
 {
     HS     = GameObject.FindObjectOfType <HSController>();
     button = GetComponent <Button>();
     button.interactable = false;
 }
Пример #22
0
    void OnGUI()
    {
        int menuWidth  = (int)(Screen.width * 0.6);
        int menuHeight = (int)(Screen.height * 0.7);
        int xStart     = Screen.width / 2 - menuWidth / 2;
        int yStart     = (int)(Screen.height * 0.2);
        int xOfsset    = (int)(menuWidth * 0.2);
        int yOfsset    = (int)(Screen.height * 0.1);

//		GameObject grid = GameObject.Find ("Grid");
//		var gridScript = grid.GetComponent<Grid> ();
        //GUI.Box (new Rect (0, 0, menuWidth * 0.45f, yOfsset), "max:" + gridScript.maxHeight ());
        GUI.Box(new Rect(0, 0, menuWidth * 0.45f, yOfsset), "Player Score: " + player_score);
        if (gameType == 2)
        {
            if (GUI.Button(new Rect(25, 50, menuWidth * 0.6f, yOfsset), comPlay ? "Computer Control" : "Player Control"))
            {
                comPlay = !comPlay;
                if (comPlay)
                {
                    GameObject shapeMaker       = GameObject.Find("ShapeMaker");
                    var        shapeMakerScript = shapeMaker.GetComponent <ShapeMakerScript> ();
                    var        shape            = shapeMakerScript.lastShape;

                    var kaka = shape.AddComponent <PathFinder> ();
                    kaka.cube = shapeMakerScript.cube;
                }
            }
        }

        if (!pause && enterName)
        {
            stringToEdit = GUI.TextField(new Rect((float)xStart + xOfsset, (float)(yStart + yOfsset * 3), menuWidth * 0.6f, yOfsset), stringToEdit, 25);
            if (GUI.Button(new Rect((float)xStart + xOfsset, (float)(yStart + yOfsset * 4), menuWidth * 0.6f, yOfsset), "Submit Score"))
            {
                //GameObject HScont = GameObject.Find ("HSController");
                //var HScontScript = HScont.GetComponent<Grid> ();
                StartCoroutine(HSController.PostScores(stringToEdit, player_score));
                enterName = false;
            }
        }
        if (pause)
        {
            GUI.Box(new  Rect(xStart, yStart, menuWidth, menuHeight), "Game Paused");
            if (GUI.Button(new Rect((float)xStart + xOfsset, (float)yStart + yOfsset, menuWidth * 0.6f, yOfsset), "Resume Game"))
            {
                //ResetGame();
                pause = false;
            }

            if (GUI.Button(new Rect((float)xStart + xOfsset, (float)(yStart + yOfsset * 2.5), menuWidth * 0.6f, yOfsset), "Restart Game"))
            {
                //ResetGame();
                Application.LoadLevel("MainScene");
            }

            if (GUI.Button(new Rect((float)xStart + xOfsset, (float)(yStart + yOfsset * 4), menuWidth * 0.6f, yOfsset), "Exit to main menu"))
            {
                Application.LoadLevel("MainMenuScene");
            }

            if (GUI.Button(new Rect(Screen.width - 105, 5, 100, 60), "Sound: ON/OFF"))
            {
                GameObject sound = GameObject.Find("Korobeiniki3");
                if (sound.audio.mute)
                {
                    sound.audio.mute = false;
                }
                else
                {
                    sound.audio.mute = true;
                }
            }
        }
    }
Пример #23
0
 void Start()
 {
     highScoreScript = GetComponent <HSController> ();
 }
Пример #24
0
    ///////////////////////////////////////////////////////////////////////////////
    // functions
    ///////////////////////////////////////////////////////////////////////////////
    // ------------------------------------------------------------------
    // Desc:
    // ------------------------------------------------------------------
    void Awake()
    {
        // ========================================================
        // system setup
        // ========================================================

        Application.targetFrameRate = 60;
        if ( dontDestroy )
            DontDestroyOnLoad(gameObject);

        // ========================================================
        // get cached components
        // ========================================================

        hsController = GetComponent<HSController>();

        // ========================================================
        // load game progress and initialize
        // ========================================================

        gameProgress = GetComponent<GameProgress>();
        if ( gameProgress != null ) {
            gameProgress.LoadPlayerProfile();
            // ApplyPlayerProfile();
        }

        // ========================================================
        // here we will create instance to get the default value and prevent NULL reference
        // ========================================================

        if ( playerProfile == null ) {
            playerProfile = new PlayerProfile();
        }
    }
Пример #25
0
	// Use this for initialization
	void Start () {
		achieveGet = gameObject.GetComponent<HSController> ();
		achieveGet.getAchievements ();
		userID = SystemInfo.deviceUniqueIdentifier;
	}
Пример #26
0
 // Use this for initialization
 void Start()
 {
     hs = gameObject.GetComponent<HSController>();
     StartCoroutine(hs.GetScores());
 }