Beispiel #1
0
        public override void OnStart(PartModule.StartState state)
        {
            base.OnStart(state);
            if (!HighLogic.LoadedSceneIsFlight)
            {
                return;
            }

            transformArray = part.FindModelTransforms(thrustTransformName);
            if (transformArray.Length > 0)
            {
                transformsFound = true;
                particleFX      = new Firespitter.FSparticleFX[transformArray.Length];
            }
            else
            {
                Log.info("KTvelocityController: Transforms not found named {0}, disabling the module", thrustTransformName);
                this.enabled = false;
            }

            if (this.enabled && particleTextureName != string.Empty)
            {
                // set up fx ---- TODO, assign each transform its own FX
                particleTexture = GameDatabase.Instance.GetTexture(particleTextureName, false);
                if (particleTexture != null)
                {
                    for (int i = 0; i < particleFX.Length; i++)
                    {
                        particleFX[i] = new Firespitter.FSparticleFX(transformArray[i].gameObject, particleTexture);
                        particleFX[i].EmitterLocalVelocity = EmitterLocalVelocity;
                        Log.dbg("KTvelocityController: particle texture found: {0}", particleTextureName);
                        particleFX[i].setupFXValues();
                        particleFX[i].pEmitter.minEmission   = 0f;
                        particleFX[i].pEmitter.maxEmission   = 0f;
                        particleFX[i].pEmitter.useWorldSpace = false;
                    }
                }
                else
                {
                    useFX = false;
                    Log.info("KTvelocityController: particle texture not found, disabling fx");
                }
            }
        }
        public override void OnStart(PartModule.StartState state)
        {
            base.OnStart(state);
            if (!HighLogic.LoadedSceneIsFlight) return;

            transformArray = part.FindModelTransforms(thrustTransformName);
            if (transformArray.Length > 0)
            {
                transformsFound = true;
                particleFX = new Firespitter.FSparticleFX[transformArray.Length];
            }
            else
            {
                Debug.Log("KTvelocityController: Transforms not found named " + thrustTransformName + ", disabling the module");
                this.enabled = false;
            }

            if (this.enabled && particleTextureName != string.Empty)
            {
                // set up fx ---- TODO, assign each transform its own FX
                particleTexture = GameDatabase.Instance.GetTexture(particleTextureName, false);
                if (particleTexture != null)
                {
                    for (int i = 0; i < particleFX.Length; i++)
                    {
                        particleFX[i] = new Firespitter.FSparticleFX(transformArray[i].gameObject, particleTexture);
                        particleFX[i].EmitterLocalVelocity = EmitterLocalVelocity;
                        //Debug.Log("KTvelocityController: particle texture found: " + particleTextureName);
                        particleFX[i].setupFXValues();
                        particleFX[i].pEmitter.minEmission = 0f;
                        particleFX[i].pEmitter.maxEmission = 0f;
                        particleFX[i].pEmitter.useWorldSpace = false;
                    }
                }
                else
                {
                    useFX = false;
                    Debug.Log("KTvelocityController: particle texture not found, disabling fx");
                }
            }
        }