コード例 #1
0
ファイル: DompaZones.cs プロジェクト: Aweponken/snoboll
    void activateZone()
    {
        int rand = Random.Range(0, zonesArray.Length);



        if (zonesArray[rand].activeSelf == false)
        {
            dompazone script = (dompazone)zonesArray[rand].GetComponent(typeof(dompazone));
            zonesArray[rand].SetActive(true);
            zonesArray[rand].transform.position = new Vector3(zonesArray[rand].transform.position.x + 0.1f, zonesArray[rand].transform.position.y, 0);
            zonesArray[rand].transform.position = new Vector3(zonesArray[rand].transform.position.x - 0.1f, zonesArray[rand].transform.position.y, 0);
            isTwoActive++;
            script.decideType();
        }
    }
コード例 #2
0
ファイル: DompaZones.cs プロジェクト: Aweponken/snoboll
    // Use this for initialization
    void Start()
    {
        counter           = Random.Range(minTime, maxTime);
        counterSecondZone = Random.Range(minTime, maxTime);
        zonesArray        = GameObject.FindGameObjectsWithTag("Zone");

        foreach (GameObject i in zonesArray)
        {
            i.SetActive(false);
            dompazone script = (dompazone)i.GetComponent(typeof(dompazone));
            Debug.Log("falskt");
            script.snowF();
            script.molnF();
            script.molnF2();
            script.fireF();
        }
    }