コード例 #1
0
    private void Awake()
    {
        DontDestroyOnLoad(this);

        if (scoreStatic == null)
        {
            scoreStatic = this;
        }
        else
        {
            Destroy(gameObject);
        }
    }
コード例 #2
0
    void Start()
    {
        myText            = gameObject.GetComponent <Text>();
        scoreHolderScript = GameObject.Find("Scoreholder").GetComponent <scoreHolder>();

        if (scoreHolderScript.score == 0)
        {
            myText.text = ("Stop trying to break the game. You got 0 points. It's a draw.");
        }
        else if (scoreHolderScript.score > 0 && scoreHolderScript.score != 69)
        {
            myText.text = positiveText[Random.Range(0, positiveText.Count)];
        }
        else if (scoreHolderScript.score == 69)
        {
            myText.text = ("Nice");
        }
        else
        {
            myText.text = negativeText[Random.Range(0, negativeText.Count)];
        }
    }
コード例 #3
0
 void Start()
 {
     theAllSeeingScoreHolder = GameObject.Find("Scoreholder").GetComponent <scoreHolder>();
 }
コード例 #4
0
 void Start()
 {
     myScoreHolder = GameObject.Find("Scoreholder").GetComponent <scoreHolder>();
 }