예제 #1
0
    // Use this for initialization
    void Start()
    {
        // Create a array to hold the number of possible effects
        objects = new CloudStream[CloudEffects.Count];

        // temp counter
        int counter = 0;

        foreach (var effect in CloudEffects)
        {
            // Equally space all the effects across the screen and init them
            objects[counter] = effect.SpawnEffect(GetStartParticlePosition(counter, CloudEffects.Count));
            counter++;
        }

        // In an ideal world this would have been more Unityy but I'm used to C++...
        windEffect = new GlobalWind(objects);
        // To save on GC, only allocate this once
        spectrum = new float[FrequencyBuckets];
    }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     _globalWindController = GlobalWind.GetComponent <GlobalWindController>();
     transform.position    = new Vector3(0f, 0f, 100f);
 }