[08_DarkSea/Unity-19050-08-DarkSea]

Added alpha feature.
master
LH 5 years ago
parent c1714a599f
commit fb34ad9195
  1. 6
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/movieController.cs
  2. 4
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/tuio_event.cs

@ -29,6 +29,8 @@ public class movieController : MonoBehaviour
public AudioClip step4; public AudioClip step4;
*/ */
public float alpha_max = 0.5f;
bool playAud; bool playAud;
float alpha; float alpha;
@ -65,9 +67,9 @@ public class movieController : MonoBehaviour
else if (stat == 1) else if (stat == 1)
{ {
alpha += fade_speed * 5f; alpha += fade_speed * 5f;
if (alpha >= 1) if (alpha >= alpha_max)
{ {
alpha = 1; alpha = alpha_max;
stat = 2; stat = 2;
} }
} }

@ -34,6 +34,9 @@ public class tuio_event : MonoBehaviour
[Range(0.01f, 5f)] [Range(0.01f, 5f)]
public float img_wait_sec = 2f; public float img_wait_sec = 2f;
[Config]
[Range(0.01f, 1.0f)]
public float snow_alpha_max = 1.0f;
//[Config] //[Config]
//[Range(0f, 1f)] //[Range(0f, 1f)]
//public float audio_volume = 1f; //public float audio_volume = 1f;
@ -57,6 +60,7 @@ public class tuio_event : MonoBehaviour
movie.size = new Vector2(snow_size, snow_size); movie.size = new Vector2(snow_size, snow_size);
//movie.volume = audio_volume; //movie.volume = audio_volume;
movie.id = id; movie.id = id;
movie.alpha_max = snow_alpha_max;
movies.Add(id, movie); movies.Add(id, movie);
var rt = movie.transform as RectTransform; var rt = movie.transform as RectTransform;
rt.anchoredPosition = touches[id].position; rt.anchoredPosition = touches[id].position;

Loading…
Cancel
Save