void Start()
    {
        var soundManagerObj = GameObject.FindGameObjectWithTag("SoundManager");

        if (soundManagerObj != null)
        {
            soundManager = soundManagerObj.GetComponent <SoundManager>();
        }

        char_con = GetComponent <CharacterController>();

        GameObject score_object_instance = GameObject.FindGameObjectWithTag("Data");
        GameObject score_object;

        if (score_object_instance == null)
        {
            Debug.Log("NULL");
            score_object = Instantiate(score_storage_object_prefab);
        }
        else
        {
            Debug.Log("NOT NULL");
            score_object = score_object_instance;
        }
        score_comp = score_object.GetComponent <Score_Transfer>();
    }
Ejemplo n.º 2
0
    public void Add_Name_Clicked()
    {
        GameObject     score_saver = GameObject.FindGameObjectWithTag("Data");
        Score_Transfer score_t     = score_saver.GetComponent <Score_Transfer>();

        if ((score_t != null) && (has_score_updated == false))
        {
            Add_Score(initials_field.text, score_t.player_score);
            has_score_updated = true;
        }
    }
Ejemplo n.º 3
0
 private int displayed_score = 0; // The displayed score used to increment the display to the correct score over time
 // Start is called before the first frame update
 void Start()
 {
     score_system = GameObject.FindGameObjectWithTag("Data").GetComponent <Score_Transfer>();
 }