Responsible for config-based simple lighting animation. Cannot/does not move transforms (hanlded through link to SSTUAnimateControlled). Intended handle float-curve based animations for emissive and light-transform setups. Loop animation will play from front-back-front-back, etc; front (start) should be the same state as the end as the on animation (not enforced...)
상속: SSTUTools.SSTUPartModuleConfigEnabled
예제 #1
0
        public void createAnimationClips(Transform root)
        {
            Transform[] transforms = root.FindChildren(transformName);
            int         len        = transforms.Length;

            Transform transform;
            Light     light;

            for (int i = 0; i < len; i++)
            {
                transform = transforms[i];
                light     = transform.GetComponent <Light>();
                if (light == null)
                {
                    light = transform.gameObject.AddComponent <Light>();//add it if it does not exist
                }

                //set light params to the config specified parameters
                light.intensity   = intensity;
                light.range       = range;
                light.spotAngle   = angle;
                light.type        = type;
                light.cullingMask = light.cullingMask & ~(1 << 10);//flip the layer 10 bit to ignore scaled scenery, keep existing mask except for layer 10
                SSTUAnimateLight.createLightAnimation(name, transforms[i], redCurve, greenCurve, blueCurve);
            }
        }
예제 #2
0
        public void createAnimationClips(Transform root)
        {
            Transform[] transforms = root.FindChildren(transformName);
            int         len        = transforms.Length;

            for (int i = 0; i < len; i++)
            {
                SSTUAnimateLight.createEmissiveAnimation(name, transforms[i], redCurve, greenCurve, blueCurve);
            }
        }
예제 #3
0
 public LightData(ConfigNode node)
 {
     name          = node.GetStringValue("name", "lightAnimation");
     transformName = node.GetStringValue("transformName");
     intensity     = node.GetFloatValue("intensity");
     range         = node.GetFloatValue("range");
     angle         = node.GetFloatValue("angle");
     type          = (LightType)Enum.Parse(typeof(LightType), node.GetStringValue("type", LightType.Point.ToString()));
     redCurve      = node.HasNode("redCurve") ? node.GetFloatCurve("redCurve") : SSTUAnimateLight.createDefaultCurve();
     greenCurve    = node.HasNode("greenCurve") ? node.GetFloatCurve("greenCurve") : SSTUAnimateLight.createDefaultCurve();
     blueCurve     = node.HasNode("blueCurve") ? node.GetFloatCurve("blueCurve") : SSTUAnimateLight.createDefaultCurve();
 }
예제 #4
0
 public EmissiveData(ConfigNode node)
 {
     this.name          = node.GetStringValue("name", "emissiveAnimation");
     this.transformName = node.GetStringValue("transformName");
     redCurve           = node.HasNode("redCurve") ? node.GetFloatCurve("redCurve") : SSTUAnimateLight.createDefaultCurve();
     greenCurve         = node.HasNode("greenCurve") ? node.GetFloatCurve("greenCurve") : SSTUAnimateLight.createDefaultCurve();
     blueCurve          = node.HasNode("blueCurve") ? node.GetFloatCurve("blueCurve") : SSTUAnimateLight.createDefaultCurve();
 }