Nelze vybrat více než 25 témat
Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
Tento repozitář je archivovaný. Můžete prohlížet soubory, klonovat, ale nemůžete nahrávat a vytvářet nové úkoly a požadavky na natažení.
|
- using System;
- using System.Collections.Generic;
- using UnityEngine;
-
- class ActionFadeTo : ActionInterval
- {
- public float value;
- public float delta;
-
- public ActionFadeTo(float tgtValue, float tgtDuration)
- : base(tgtDuration)
- {
- value = tgtValue;
- }
-
- public override Action clone()
- {
- return new ActionFadeTo(value, duration);
- }
-
- public override void start()
- {
- base.start();
- delta = value - target.gameObject.renderer.material.color.a;
- }
-
- public override void stepInterval(float dt)
- {
- float d = dt / duration;
- Color tgtColor = target.gameObject.renderer.material.color;
- tgtColor[3] += delta * d;
- target.gameObject.renderer.material.color = tgtColor;
- }
- }
|