示例#1
0
 public override void OnLoad(ConfigNode node)
 {
     ConfigNode.LoadObjectFromConfig(this, node);
     volume.Load("volume", node);
     pitch.Load("pitch", node);
     lowpass.Load("lowpass", node);
 }
示例#2
0
    public override void OnLoad(ConfigNode node)
    {
        //Print("OnLoad");
        Backup(node);

        emission      = new MultiInputCurve("emission");
        energy        = new MultiInputCurve("energy");
        speed         = new MultiInputCurve("speed");
        grow          = new MultiInputCurve("grow", true);
        scale         = new MultiInputCurve("scale");
        size          = new MultiInputCurve("size");
        offset        = new MultiInputCurve("offset", true);
        force         = new MultiInputCurve("force", true);
        logGrow       = new MultiInputCurve("logGrow", true);
        linGrow       = new MultiInputCurve("linGrow", true);
        logGrowScale  = new MultiInputCurve("logGrowScale");
        alpha         = new MultiInputCurve("alpha");
        linAlphaDecay = new MultiInputCurve("linAlphaDecay", true);
        logAlphaDecay = new MultiInputCurve("logAlphaDecay", true);
        initalVelocityOffsetMaxRadius = new MultiInputCurve("initalVelocityOffsetMaxRadius", true);
        sizeClampCurve = new MultiInputCurve("sizeClamp", true);
        randConeEmit   = new MultiInputCurve("randConeEmit", true);
        vRandPosOffset = new MultiInputCurve("vRandPosOffset", true);
        vPosOffset     = new MultiInputCurve("vPosOffset", true);
        xyForce        = new MultiInputCurve("xyForce", false);
        zForce         = new MultiInputCurve("zForce", false);

        ConfigNode.LoadObjectFromConfig(this, node);
        emission.Load(node);
        energy.Load(node);
        speed.Load(node);
        grow.Load(node);
        scale.Load(node);
        size.Load(node);
        offset.Load(node);
        force.Load(node);
        logGrowScale.Load(node);
        logGrow.Load(node);
        linGrow.Load(node);
        alpha.Load(node);
        linAlphaDecay.Load(node);
        logAlphaDecay.Load(node);
        initalVelocityOffsetMaxRadius.Load(node);
        sizeClampCurve.Load(node);
        randConeEmit.Load(node);
        vRandPosOffset.Load(node);
        vPosOffset.Load(node);
        xyForce.Load(node);
        zForce.Load(node);

        angle.Load("angle", node);
        distance.Load("distance", node);
        layerId = LayerMask.NameToLayer(layer);

        loaded = true;
    }
    public override void OnLoad(ConfigNode node)
    {
        //print("OnLoad");

        // Use the actual part cfg instead of what KSP provides because
        // the node provided for the root part after a load/scene change is empty
        if (HighLogic.LoadedScene != GameScenes.LOADING && !node.HasNode())
        {
            node = GetEffectConfig();

            if (node == null)
            {
                Log.info(
                    "Unable to find the effect config for part {0} effectName {1} instanceName {2}",
                    hostPart.protoPartSnapshot.partName, effectName, instanceName
                    );
                return;
            }
        }

        // Backup the config because this effect config goes beyond the 7 deep serialization restriction and we get a node without the InputCurves
        // A cheap hack but fixing this takes way too much compile/reloading...

        Backup(node);

        //print("OnLoad :\n" + node);

        emission       = new MultiInputCurve("emission");
        energy         = new MultiInputCurve("energy");
        speed          = new MultiInputCurve("speed");
        grow           = new MultiInputCurve("grow", true);
        scale          = new MultiInputCurve("scale");
        size           = new MultiInputCurve("size");
        offset         = new MultiInputCurve("offset", true);
        force          = new MultiInputCurve("force", true);
        logGrow        = new MultiInputCurve("logGrow", true);
        linGrow        = new MultiInputCurve("linGrow", true);
        logGrowScale   = new MultiInputCurve("logGrowScale");
        alpha          = new MultiInputCurve("alpha");
        linAlphaDecay  = new MultiInputCurve("linAlphaDecay", true);
        logAlphaDecay  = new MultiInputCurve("logAlphaDecay", true);
        saturationMult = new MultiInputCurve("saturationMult");
        brightnessMult = new MultiInputCurve("brightnessMult");
        alphaMult      = new MultiInputCurve("alphaMult");
        initalVelocityOffsetMaxRadius = new MultiInputCurve("initalVelocityOffsetMaxRadius", true);
        sizeClampCurve = new MultiInputCurve("sizeClamp", true);
        randConeEmit   = new MultiInputCurve("randConeEmit", true);
        vRandPosOffset = new MultiInputCurve("vRandPosOffset", true);
        vPosOffset     = new MultiInputCurve("vPosOffset", true);
        xyForce        = new MultiInputCurve("xyForce", false);
        zForce         = new MultiInputCurve("zForce", false);

        ConfigNode.LoadObjectFromConfig(this, node);
        emission.Load(node);
        energy.Load(node);
        speed.Load(node);
        grow.Load(node);
        scale.Load(node);
        size.Load(node);
        offset.Load(node);
        force.Load(node);
        logGrowScale.Load(node);
        logGrow.Load(node);
        linGrow.Load(node);
        alpha.Load(node);
        linAlphaDecay.Load(node);
        logAlphaDecay.Load(node);
        initalVelocityOffsetMaxRadius.Load(node);
        saturationMult.Load(node);
        brightnessMult.Load(node);
        alphaMult.Load(node);
        sizeClampCurve.Load(node);
        randConeEmit.Load(node);
        vRandPosOffset.Load(node);
        vPosOffset.Load(node);
        xyForce.Load(node);
        zForce.Load(node);

        angle.Load("angle", node);
        distance.Load("distance", node);
        layerId = LayerMask.NameToLayer(layer);

        loaded = true;
    }