Esempio n. 1
0
    void Start()
    {
        bounds = new Bounds(center, 2 * extend * DefaultVoxManager.getDefault().getRatio());
        ps     = GetComponent <ParticleSystem>();

        switch (mode)
        {
        case ParticleSystemEmitMode.GRAVITY:
            impl = new ParticleSystemObjectGravityImpl(bounds, ps, heightRange, needTranslation);
            break;

        case ParticleSystemEmitMode.NORMAL:
            impl = new ParticleSystemObjectImpl(bounds, ps, heightRange, needTranslation);
            break;

        case ParticleSystemEmitMode.FIREWORK:
            impl = new ParticleSystemObjectFireworksImpl(bounds, ps, heightRange, needTranslation);
            break;

        case ParticleSystemEmitMode.CONTINUOUS:
            impl = new ParticleSystemObjectContinuousImpl(bounds, ps, heightRange, needTranslation);
            break;

        default:
            throw new NotImplementedException();
        }
    }
Esempio n. 2
0
    void Start()
    {
        regions = new Region[]
        {
            new Region()
            {
                center = new Vector2(centerstep, centerstep), area = new Vector2(rangestep, rangestep)
            },
            new Region()
            {
                center = new Vector2(-centerstep, centerstep), area = new Vector2(rangestep, rangestep)
            },
            new Region()
            {
                center = new Vector2(centerstep, -centerstep), area = new Vector2(rangestep, rangestep)
            },
            new Region()
            {
                center = new Vector2(-centerstep, -centerstep), area = new Vector2(rangestep, rangestep)
            },
        };

        for (int i = 0; i < po.Length; i++)
        {
            GameObject go = GameObject.Find("/PS" + i);
            if (go == null)
            {
                continue;
            }
            po[i] = go.GetComponent <IParticleObject>();
        }
        for (int i = 0; i < randomEffects.Length; i++)
        {
            GameObject go = GameObject.Find("/Random" + i);
            if (go == null)
            {
                continue;
            }
            randomEffects[i] = go.GetComponent <IParticleObject>();
        }
        GameObject fishSplashObj = GameObject.Find("/FishSplash");

        if (fishSplashObj != null)
        {
            fishSplash = fishSplashObj.GetComponent <IParticleObject>();
        }

        fish = GameObject.Find("transformFizzBait").GetComponent <UpSwimFish>();

        touchControlThread = new Thread(touchControl);
        //touchControlThread.Start();
        randomEffectsControlThread = new Thread(randomEffectsControl);
        randomEffectsControlThread.Start();
    }
 void Start()
 {
     bounds = new Bounds(center, 2 * extend * DefaultVoxManager.getDefault().getRatio());
     pe     = GetComponent <EllipsoidParticleEmitter>();
     impl   = new ParticleEmitObjectImpl(bounds, pe, heightRange);
 }