コード例 #1
0
    void Start()
    {
        //octopi
        for (int i = 0; i < OctopusCount; i++)
        {
            octopus = new chapter1Creature();
            octopi.Add(octopus);
        }
        //wisps
        for (int i = 0; i < WispCount; i++)
        {
            Vector3  randomLocation = new Vector3(Random.Range(0, 100), Random.Range(3, 100), Random.Range(0, 100));
            Vector3  randomVelocity = new Vector3(Random.Range(-2f, 2f), Random.Range(-2f, 2f), Random.Range(-2f, 2f));
            Mover2_7 m = new Mover2_7(Random.Range(0.2f, .5f), randomVelocity, randomLocation); //Each Mover is initialized randomly.
            movers.Add(m);
        }
        a = new Attractor2_7();
        //worms
        for (int i = 0; i < WormCount; i++)
        {
            float x = Random.Range(0, 100);
            float z = Random.Range(0, 100);
            float y = ExtensionMethods.Remap(Mathf.PerlinNoise(x * .06f, z * .06f), 0f, 1f, 0f, 7f);
            worms.Add(new baton(new Vector3(x, y - 1f, z)));
        }
        //fish
        for (int i = 0; i < FishCount; i++)
        {
            Vector3 randomLocation = new Vector3(Random.Range(50f, 100f), Random.Range(50f, 100f), Random.Range(50f, 20f));
            Vector3 randomVelocity = new Vector3(Random.Range(0f, 3f), Random.Range(0f, 3f), Random.Range(0f, 3f));
            Movers  m = new Movers(Random.Range(0.2f, 1f), randomVelocity, randomLocation); //Each Mover is initialized randomly.
            fish.Add(m);
        }
        fishLead = new fishLead();


        //randomFish
        for (int i = 0; i < randomFishCount; i++)
        {
            randomFish a = new randomFish();
            fishR.Add(a);
        }


        //squid
        randomFish2 = new randomFish2();
        while (oscillate.Count < SquidCount)
        {
            oscillator o = new oscillator(new Vector3(2f, 2f, 2f));
            o.oGameObject.transform.SetParent(randomFish2.body.transform);
            oscillate.Add(o);
            Debug.Log("Squid instantiated");
            squid.Add(randomFish2);
        }
    }
コード例 #2
0
 void Start()
 {
     a = new randomFish();
 }