コード例 #1
0
 // Use this for initialization
 void Start()
 {
     alienspawn    = GameObject.FindGameObjectWithTag("Respawn");
     floatScript   = alienspawn.GetComponent <RandomNum>();
     shooterspawn  = GameObject.FindGameObjectWithTag("ShooterRespawn");
     shooterScript = shooterspawn.GetComponent <ShooterSpawn>();
 }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        alienspawn    = GameObject.FindGameObjectWithTag("Respawn");
        floatScript   = alienspawn.GetComponent <RandomNum>();
        shooterSpawn  = GameObject.FindGameObjectWithTag("ShooterRespawn");
        shooterScript = shooterSpawn.GetComponent <ShooterSpawn>();
        answer        = GameObject.Find("my_ans").GetComponent <Text>();
        questions1    = GameObject.Find("QuestionsNum1").GetComponent <Text>();
        questions2    = GameObject.Find("QuestionsNum2").GetComponent <Text>();
        operators     = GameObject.Find("Operators").GetComponent <Text>();
        scores        = GameObject.Find("ScoreValue").GetComponent <Text>();

        // Initialize Random number
        questions1.text = (Random.Range(1, 9)).ToString();
        operators.text  = optr[Random.Range(0, 3)];
        questions2.text = (Random.Range(1, 9)).ToString();
    }