Пример #1
0
    private IEnumerator ScatterStar()   // 星をばらまく
    {
        yield return(new WaitForSeconds(1.0f));

        for (int i = 0; i < 20; i++)
        {
            Vector3    placePosition = new Vector3(Random.Range(-MaxHight / 7, MaxHight / 7), Random.Range(5.0f, MaxHight * 1.2f), 0);
            Quaternion q             = new Quaternion();
            q = Quaternion.identity;
            GameObject Star_temp = (GameObject)Instantiate(PointStar, placePosition, q);

            Star_temp.GetComponent <StarController>().scoreData = scoreData.GetComponent <ScoreData>();
            Star_temp.GetComponent <StarController>().Rocket    = Rocket.GetComponent <RocketController>();
            yield return(null);
        }
    }