示例#1
0
 // Start is called before the first frame update
 void Start()
 {
     lightTarget = GetComponentInParent <LightTarget>();
     BoxCollider2D col = GetComponent <BoxCollider2D>();
     //col.offset = new Vector2((beam.xLims[1] + beam.xLims[0]) / 2.0f, beam.beamLength / 2.0f);
     //col.size = new Vector2(beam.xLims[1] - beam.xLims[0], beam.beamLength);
 }
 void OnEnable()
 {
     lightTarget       = GetComponent <LightTarget>();
     intensity         = lightTarget.lightTargetParameters.intensity;
     indirectIntensity = lightTarget.lightTargetParameters.indirectIntensity;
     range             = lightTarget.lightTargetParameters.range;
     colorTemperature  = lightTarget.lightTargetParameters.colorTemperature;
     colorFilter       = lightTarget.lightTargetParameters.colorFilter;
     lightAngle        = lightTarget.lightTargetParameters.lightAngle;
     shadows           = lightTarget.lightTargetParameters.shadows;
     //shadowsResolution=lightTarget.lightTargetParameters.shadowsResolution;
     shadowQuality  = lightTarget.lightTargetParameters.shadowQuality;
     ShadowNearClip = lightTarget.lightTargetParameters.ShadowNearClip;
     shadowBias     = lightTarget.lightTargetParameters.shadowBias;
 }
示例#3
0
		/// <summary>
		/// tweens a Lights color property
		/// </summary>
		/// <returns>The kcolor to.</returns>
		/// <param name="self">Self.</param>
		/// <param name="to">To.</param>
		/// <param name="duration">Duration.</param>
		public static ITween<Color> ZKcolorTo( this Light self, Color to, float duration = 0.3f )
		{
			var tweenTarget = new LightTarget( self );
			var tween = ZestKit.cacheColorTweens ? QuickCache<ColorTween>.pop() : new ColorTween();
			tween.initialize( tweenTarget, self.color, to, duration );

			return tween;
		}
示例#4
0
		/// <summary>
		/// tweens a Lights spotAngle property
		/// </summary>
		/// <returns>The kspot angle to.</returns>
		/// <param name="self">Self.</param>
		/// <param name="to">To.</param>
		/// <param name="duration">Duration.</param>
		public static ITween<float> ZKspotAngleTo( this Light self, float to, float duration = 0.3f )
		{
			var tweenTarget = new LightTarget( self, LightTarget.LightTargetType.SpotAngle );
			var tween = ZestKit.cacheFloatTweens ? QuickCache<FloatTween>.pop() : new FloatTween();
			tween.initialize( tweenTarget, self.spotAngle, to, duration );

			return tween;
		}
示例#5
0
        /// <summary>
        /// tweens a Lights spotAngle property
        /// </summary>
        /// <returns>The kspot angle to.</returns>
        /// <param name="self">Self.</param>
        /// <param name="to">To.</param>
        /// <param name="duration">Duration.</param>
        public static ITween<float> ZKspotAngleTo( this Light self, float to, float duration = 0.3f )
        {
            var tweenTarget = new LightTarget( self, LightTarget.LightTargetType.SpotAngle );
            var tween = FloatTween.create();
            tween.initialize( tweenTarget, self.spotAngle, to, duration );

            return tween;
        }
示例#6
0
        /// <summary>
        /// tweens a Lights intensity property
        /// </summary>
        /// <returns>The kintensity to.</returns>
        /// <param name="self">Self.</param>
        /// <param name="to">To.</param>
        /// <param name="duration">Duration.</param>
        public static ITween<float> ZKintensityTo( this Light self, float to, float duration = 0.3f )
        {
            var tweenTarget = new LightTarget( self, LightTarget.LightTargetType.Intensity );
            var tween = FloatTween.create();
            tween.initialize( tweenTarget, self.intensity, to, duration );

            return tween;
        }
示例#7
0
        /// <summary>
        /// tweens a Lights color property
        /// </summary>
        /// <returns>The kcolor to.</returns>
        /// <param name="self">Self.</param>
        /// <param name="to">To.</param>
        /// <param name="duration">Duration.</param>
        public static ITween<Color> ZKcolorTo( this Light self, Color to, float duration = 0.3f )
        {
            var tweenTarget = new LightTarget( self );
            var tween = ColorTween.create();
            tween.initialize( tweenTarget, self.color, to, duration );

            return tween;
        }
 // Use this for initialization
 void Start()
 {
     lightTarget = GetComponent <LightTarget>();
 }
示例#9
0
 void OnEnable()
 {
     lightTarget           = (LightTarget)serializedObject.targetObject;
     lightTargetParameters = serializedObject.FindProperty("lightTargetParameters");
 }