コード例 #1
0
    void Start()
    {
        // Formations
        form1 = GameObject.FindGameObjectWithTag("phase1").gameObject;
        form2 = GameObject.FindGameObjectWithTag("phase2").gameObject;
        form3 = GameObject.FindGameObjectWithTag("phase31").gameObject;
        form4 = GameObject.FindGameObjectWithTag("phase41").gameObject;
        form5 = GameObject.FindGameObjectWithTag("phase51").gameObject;
        // Movement
        float   distance  = transform.position.z - Camera.main.transform.position.z;
        Vector3 leftMost  = Camera.main.ViewportToWorldPoint(new Vector3(0, 0, distance));
        Vector3 rightMost = Camera.main.ViewportToWorldPoint(new Vector3(1, 0, distance));

        xMin          = leftMost.x + padding;
        xMax          = rightMost.x - padding;
        moveFormation = false;

        GalagaHelper.RoundNumber = 1;
        // Starts the Game.
        Invoke("StartRound", 3.0f);
        GalagaHelper.SetPlayerIcons();
        GalagaHelper.PlacePlayerIcons();
        playerText     = GameObject.Find("PlayerText");
        roundText      = GameObject.Find("RoundTitle");
        playerTextHigh = GameObject.Find("PlayerTextHigh");
        readyText      = GameObject.Find("ReadyText");
        //playerController = GameObject.FindGameObjectWithTag("CapturedPlayer").GetComponent<PlayerController>();
        starfield = GameObject.FindGameObjectWithTag("Starfield").GetComponent <ParticleSystem>();
        playerText.SetActive(true);
        roundText.SetActive(false);
        playerTextHigh.SetActive(false);
        readyText.SetActive(false);
        //roundTextPos = playerText.transform.position;
    }