Beispiel #1
0
    public void ShotDown()
    {
        ScoreManagerScript scoreKeeper = (ScoreManagerScript)FindObjectOfType(typeof(ScoreManagerScript));

        scoreKeeper.score += scoreValue;
        Destroy(this.gameObject);
    }
    // Use this for initialization
    void Start()
    {
        scoremanager = GameObject.Find("ScoreManager");
        SMS          = scoremanager.GetComponent <ScoreManagerScript> ();

        score_text.text = SMS.score + "/10";
    }
    // Use this for initialization
    void Start()
    {
        scoremanager = GameObject.Find("ScoreManager");
        SMS          = scoremanager.GetComponent <ScoreManagerScript> ();

        questnum = 1;

        correct.SetActive(false);
        incorrect.SetActive(false);

        ri = display.GetComponent <RawImage> ();

        button.text     = "解答する";
        IF.interactable = true;
        IF.text         = "";

        mentordata = new Mentor[tex.Length];
        for (int i = 0; i < tex.Length; i++)
        {
            mentordata [i] = new Mentor(tex[i], menname[i]);
        }

        mentor = mentordata.OrderBy(i => Guid.NewGuid()).ToArray();

        nownumber  = 0;       //UnityEngine.Random.Range (0,mentor.Length);
        ri.texture = mentor [nownumber].image;
    }
Beispiel #4
0
 void Awake()
 {
     if (current == null)
     {
         current = this;
     }
 }
Beispiel #5
0
 private void Awake()
 {
     scoreText = GameObject.Find("ScoreText").GetComponent <Text>();
     if (instance == null)
     {
         instance = this;
     }
 }
Beispiel #6
0
    IEnumerator gameover()
    {
        yield return(new WaitForSeconds(.1f));

        ScoreManager       = GameObject.Find("ScoreManager");
        ScoreManagerScript = ScoreManager.GetComponent <ScoreManagerScript>();
        finalScore         = ScoreManagerScript.score;
        FinalScore.text    = finalScore.ToString();
    }
Beispiel #7
0
    // Start is called before the first frame update
    void Start()
    {
        platformStartPoint = platformGenerator.position;
        playerStartPoint   = thePlayer.transform.position;

        theScoreManager = FindObjectOfType <ScoreManagerScript>();
        theCoinManager  = FindObjectOfType <CoinManager>();
        Time.timeScale  = 1;
    }
Beispiel #8
0
    void Start()
    {
        anim = GetComponent <Animator>();

        Poppable             = false;
        transform.localScale = Vector3.zero;
        SM = GameObject.FindGameObjectWithTag("ScoreManager").GetComponent <ScoreManagerScript>();
        ScoreModifierPrefab = Resources.Load("Prefabs/ScoreChangeSprite");
    }
 // Start is called before the first frame update
 void Start()
 {
     textLife.text   = string.Format("Life: {0}", GameState.life);
     textCherry.text = string.Format("x{0}", GameState.score);
     if (instance == null)
     {
         instance = this;
     }
 }
Beispiel #10
0
    public void ShotDown()
    {
        ScoreManagerScript scoreKeeper = FindObjectOfType <ScoreManagerScript>();

        scoreKeeper.score += scoreValue;
        GameObject effect = (GameObject)Instantiate(deathEffect, transform.position, Quaternion.identity);

        Destroy(this.gameObject);
    }
Beispiel #11
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     gameScore          = 0;
     bestScoreText.text = PlayerPrefs.GetInt("Best").ToString();
 }
Beispiel #12
0
    // Use this for initialization
    void Start()
    {
        ScoreManager_Script = GameObject.FindGameObjectWithTag("ScoreManager").GetComponent <ScoreManagerScript>();
        SM_Script           = GameObject.FindGameObjectWithTag("SoundManager").GetComponent <SoundManagerScript>();

        tempLifeNum = 0;
        //lifeTest = 0;
        //tempValue = 0;
    }
 private void DisplayScores()
 {
     if (!(GetComponent <Achievements> ().tag == "DeathGUI"))
     {
         GetComponentsInChildren <Text> () [0].text = Constants.SCORE + ScoreManagerScript.Score;
         ScoreManagerScript.SetHighScore(ScoreManagerScript.Score);
         GetComponentsInChildren <Text> () [1].text = "High Score:  " + PlayerPrefs.GetInt("highscore");
     }
     GameController.GetInstance.WinEvent -= OnPlayerWin;
 }
Beispiel #14
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
Beispiel #15
0
    // Use this for initialization
    void Start()
    {
        gameManager  = GameObject.Find("GameManager");
        scoreManager = gameManager.GetComponent <ScoreManagerScript> ();
        hms          = gameManager.GetComponent <HealthManagerScript> ();
        pms          = gameObject.GetComponent <PlayerMovementScript> ();
        healthText   = GameObject.Find("Health").GetComponent <Text> ();

        healthText.text = "Health Remaining: " + hms.BoxHealth;
        healthTextColorChanger();
    }
Beispiel #16
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.gameObject.tag != "Player" || shouldDestroy)
        {
            return;
        }

        ScoreManagerScript.addPoints(pointsToAdd);
        source.Play();
        shouldDestroy = true;
    }
 // Use this for initialization
 void Start()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(this);
     }
     else
     {
         Destroy(gameObject);
     }
 }
    // Start is called before the first frame update
    void Start()
    {
        level       = 0;
        pirateLevel = 0;
        Level.gameObject.SetActive(false);
        LevelText.gameObject.SetActive(false);
        PirateText.gameObject.SetActive(false);

        scoreManager       = GameObject.Find("ScoreManager");
        scoreManagerScript = scoreManager.GetComponent <ScoreManagerScript>();
        scoreManagerScript.revive();
    }
Beispiel #19
0
 /// <summary>
 /// Start this instance.
 /// </summary>
 void Start()
 {
     transform.position -= Vector3.up * 0.5f;
     currentState        = States.EarWiggle;
     candyNum            = Random.Range(1, 5);
     //transform.GetChild(0).GetComponent<BunnyCandyScript>().InitialiseVariables(candyNum);
     //bunnyCandy = Instantiate(Resources.Load("Prefabs/Bunny/Candy" + candyNum)) as GameObject;
     //bunnyCandy.transform.SetParent(this.transform);
     //bunnyCandy.transform.localScale = Vector3.one;
     //bunnyCandy.transform.localPosition = Vector3.up;
     anim              = GetComponent <Animator>();
     candyAnim         = transform.GetChild(0).GetComponent <Animator>();
     scoreChangePrefab = Resources.Load("Prefabs/ScoreChangeSprite");
     dissapearing      = false;
     SM = GameObject.FindGameObjectWithTag("ScoreManager").GetComponent <ScoreManagerScript>();
     StartCoroutine(AppearTransition());
 }
 // Use this for initialization
 void Start()
 {
     //if this is the first intance of the singleton
     //instance will not be set yet
     if (instance == null)
     {
         //set instance to this instance of ScoreManager
         instance = this;
         //Dont destroy this gameObject when you go to a new scene
         DontDestroyOnLoad(this);
     }
     else             //otherwise, if we already have a singleton
                      //Destroy the new one, since there can only be one
     {
         Destroy(gameObject);
     }
 }
    private void Awake()
    {
        manager      = GameObject.FindGameObjectWithTag("Manager");
        scoreManager = (ScoreManagerScript)FindObjectOfType(typeof(ScoreManagerScript));
        //Debug.Log(scoreManager);
        transition = GameObject.Find("Transition").GetComponent <Transition>();

        totalScore.text    = "Total Score: " + scoreManager.getTotalScore();
        killScore.text     = "Killing Points: " + scoreManager.getKillScore();
        negativeScore.text = "Fault Points: " + scoreManager.getNegativeScore();
        timeScore.text     = "Time Bonus: " + scoreManager.getTimeScore();
        text      = scoreManager.getStoryText();
        nextScene = scoreManager.getNextScene();


        Destroy(manager);
    }
Beispiel #22
0
    //Use this for initialization
    void Awake()
    {
        instance        = this;
        wavesCleared    = 0;
        enemyCardsDrawn = 0;
        flawless        = true;

        //load player decks if the file exists, or create an empty collection if not.
        //This file is local even on web builds, so it doesn't need special handling
        try
        {
            string filePath = Path.Combine(Application.persistentDataPath, "playerScores.xml");
            using (FileStream stream = new FileStream(filePath, FileMode.Open))
                playerScores = ScoreCollection.Load(stream, filePath);
        }
        catch (Exception e)
        {
            Debug.Log("no score save file found. (" + e.Message + ")");
            playerScores = new ScoreCollection();
        }
    }
    public void HighScoreClick()
    {
        var active = !PanelHighScore.activeInHierarchy;

        if (active)
        {
            TextDifficulty.text = "" + GameDifficulty + "";
            TextHighScore.text  = ScoreManagerScript.GetScoreByDifficulty(GameDifficulty).ToString();
        }


        HideDifficultyPanel();

        if (active)
        {
            ShowHighScorePanel();
        }
        else
        {
            HideHighScorePanel();
        }
    }
Beispiel #24
0
    public void BirdDied()
    {
        mBirdObj.GetComponent <Animator> ().enabled = false;
        ResetSpeed(mTreesObj, 0, 0);
        ResetSpeed(mMountainsObj, 0, 0);
        ResetSpeed(mFloorObj, 0, 0);
        ResetSpeed(mCoinObj, 10, 0);
        isGameOver = true;
        DestroyAllObjects(Constants.TAG_LASER);
        DestroyAllObjects(Constants.TAG_COIN);
        GetComponent <AudioManager>().PlayOneShot(DeathAudioClip);

        if (ScoreManagerScript.SetHighScore(ScoreManagerScript.Score))
        {
            GetComponent <AudioManager>().PlayOneShot(ApplauseClip);
        }

        //Invoke the method from Achievements.cs to display the high score and other achievements
        if (deathEvent != null)
        {
            deathEvent();
        }
        dialogsComponent.SetActive(true);
    }
Beispiel #25
0
 /// <summary>
 /// When Bird scores
 /// </summary>
 /// <param name="obj">Object.</param>
 /// <param name="points">Points.</param>
 public void BirdScored(GameObject obj, int points)
 {
     GetComponent <AudioManager>().PlayOneShot(ScoredAudioClip);
     ScoreManagerScript.incrementScore(points);
     DestroyObject(obj);
 }
 void Start()
 {
     ScoreManager_Script = GameObject.FindGameObjectWithTag("ScoreManager").GetComponent <ScoreManagerScript>();
     SM_Script           = GameObject.FindGameObjectWithTag("SoundManager").GetComponent <SoundManagerScript>();
 }
    // Use this for initialization
    void Start()
    {
        if( instance == null )
            instance = this;

        deathTriggerScript = deathTrigger.GetComponent<DeathTriggerScript>();
    }
 void Awake()
 {
     instance = this;
 }
Beispiel #29
0
 public static void ResetGame()
 {
     ScoreManagerScript.UpdateScore();
     StartGame = false;
 }
Beispiel #30
0
 private void SavePlayerProgress()
 {
     ScoreManagerScript.RegisterLatestScore(HUDscript.scoreValue);
 }
    public void updateScore(int stratum, int num)
    {
        ScoreManagerScript scoring = (ScoreManagerScript)(GameObject.FindObjectOfType(typeof(ScoreManagerScript)));

        scoring.recapScore(stratum, num);
    }