LH 6 years ago
commit aeb0c6c914
  1. 4
      01_ForstCoronation/Unity-19050-01_ForstCoronation/19050-01_ForstCoronation/Assets/Scenes/Ice.unity
  2. 43
      01_ForstCoronation/Unity-19050-01_ForstCoronation/19050-01_ForstCoronation/Assets/Scripts/DebugUI.cs
  3. 36
      04-IceSlide/Unity-19050-04-IceSlide/19050-04-IceSlide/Assets/Frozen/RenderTexture/MainSpout.renderTexture
  4. 8
      04-IceSlide/Unity-19050-04-IceSlide/19050-04-IceSlide/Assets/Frozen/RenderTexture/MainSpout.renderTexture.meta
  5. 1736
      04-IceSlide/Unity-19050-04-IceSlide/19050-04-IceSlide/Assets/Scenes/Main_IceSlideV2.unity
  6. 21
      04-IceSlide/Unity-19050-04-IceSlide/19050-04-IceSlide/Assets/Script/FlakeIcon.cs
  7. 88
      04-IceSlide/Unity-19050-04-IceSlide/19050-04-IceSlide/Assets/Script/FlakePosition.cs
  8. 11
      04-IceSlide/Unity-19050-04-IceSlide/19050-04-IceSlide/Assets/Script/FlakePosition.cs.meta
  9. 25
      04-IceSlide/Unity-19050-04-IceSlide/19050-04-IceSlide/Assets/Script/SnowFlakeBehaviour.cs
  10. 3
      04-IceSlide/Unity-19050-04-IceSlide/19050-04-IceSlide/Assets/Script/TouchArea.cs
  11. 2
      04-IceSlide/Unity-19050-04-IceSlide/19050-04-IceSlide/Packages/manifest.json
  12. 85
      04-IceSlide/Unity-19050-04-IceSlide/19050-04-IceSlide/settings-default.json
  13. 105
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scenes/DarkSea.unity
  14. 84
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/StatManager.cs
  15. 25
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/movieController.cs
  16. 15
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/tuio_event.cs

@ -1341,8 +1341,8 @@ MonoBehaviour:
m_ExecuteInEditor: 1
m_Bindings:
- {fileID: 1090188929}
- {fileID: 1090188931}
- {fileID: 1090188930}
- {fileID: 1090188931}
m_VisualEffect: {fileID: 1090188927}
--- !u!114 &1090188933
MonoBehaviour:
@ -1810,7 +1810,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3d9a54ec27de1e74484ba710356b1a50, type: 3}
m_Name:
m_EditorClassIdentifier:
debugMode: 1
canvas: {fileID: 396373727}
vfx: {fileID: 1090188927}
baseEmitter: {fileID: 706372899}
@ -1818,6 +1817,7 @@ MonoBehaviour:
emitter: {fileID: 1324214445}
button: {fileID: 562864505}
stat:
debugMode: 0
Emitter_x: 3.5
Target_x: -3
growing_speed: 0.008

@ -8,7 +8,7 @@ using TUIO;
public class DebugUI : MonoBehaviour
{
public bool debugMode = true;
public GameObject canvas;
public VisualEffect vfx;
public GameObject baseEmitter;
@ -17,6 +17,9 @@ public class DebugUI : MonoBehaviour
public GameObject button;
public string stat = "wait";
[Config]
public bool debugMode = false;
[Config]
[Range(0f, 5f)]
public float Emitter_x = 2.5f;
@ -42,15 +45,31 @@ public class DebugUI : MonoBehaviour
{
QualitySettings.vSyncCount = 0;
stat = "wait";
canvas.SetActive(debugMode);
//canvas.GetComponent<Canvas>().ena(debugMode);
button.GetComponent<Text>().text = stat;
lerp_val = 0;
cur_blob_count = 0;
setObjectVisible(debugMode);
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.F1))
{
debugMode = !debugMode;
//canvas.GetComponent<Canvas>().enabled = debugMode;
if (debugMode)
{
showObject = true;
setObjectVisible(showObject);
}
else
{
showObject = false;
setObjectVisible(showObject);
}
}
cur_blob_count = TUIOManager.Instance.touches.Count;
if (button.GetComponentInParent<Button>().interactable)
@ -66,26 +85,13 @@ public class DebugUI : MonoBehaviour
}
}
if (Input.GetKeyDown(KeyCode.F1))
{
debugMode = !debugMode;
canvas.GetComponent<Canvas>().enabled = debugMode;
if (debugMode)
{
showObject = true;
setObjectVisible(showObject);
}
else
{
showObject = false;
setObjectVisible(showObject);
}
}
/*
else if (debugMode && Input.GetKeyDown(KeyCode.F2))
{
showObject = !showObject;
setObjectVisible(showObject);
}
}*/
if (stat == "growing")
{
@ -167,6 +173,7 @@ public class DebugUI : MonoBehaviour
baseEmitter.GetComponent<Renderer>().enabled = isShowed;
target.GetComponent<Renderer>().enabled = isShowed;
emitter.GetComponent<Renderer>().enabled = isShowed;
button.GetComponentInParent<Button>().image.enabled = isShowed;
}
private void switchButtonStat()

@ -0,0 +1,36 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!84 &8400000
RenderTexture:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: MainSpout
m_ImageContentsHash:
serializedVersion: 2
Hash: 00000000000000000000000000000000
m_ForcedFallbackFormat: 4
m_DownscaleFallback: 0
serializedVersion: 3
m_Width: 1920
m_Height: 886
m_AntiAliasing: 1
m_DepthFormat: 2
m_ColorFormat: 8
m_MipMap: 0
m_GenerateMips: 1
m_SRGB: 0
m_UseDynamicScale: 0
m_BindMS: 0
m_EnableCompatibleFormat: 1
m_TextureSettings:
serializedVersion: 2
m_FilterMode: 1
m_Aniso: 0
m_MipBias: 0
m_WrapU: 1
m_WrapV: 1
m_WrapW: 1
m_Dimension: 2
m_VolumeDepth: 1

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c89b7927ec9d2e24bae4c4f58903aaa2
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 8400000
userData:
assetBundleName:
assetBundleVariant:

@ -47,8 +47,28 @@ public class FlakeIcon : SnowFlake
StartCoroutine(EndFade());
}
if (State == IconState.SpwanFinished || State == IconState.Spwan)
{
PerlinPos();
}
}
[Range(1, 30)] public float perlinPosScale = 1;
[Range(0,2)] public float TimeScale = 1;
[Range(0, 1)] public float smooth = 0.1f;
private void PerlinPos()
{
float perlinValueX = Mathf.PerlinNoise((Time.time + _snowFlakeBehaviour._rectTransform.anchoredPosition.x) * TimeScale, 0);
float perlinValueY = Mathf.PerlinNoise(0, (Time.time + _snowFlakeBehaviour._rectTransform.anchoredPosition.y) * TimeScale);
float valueX = Mathf.Lerp(-perlinPosScale, perlinPosScale, perlinValueX);
float valueY = Mathf.Lerp(-perlinPosScale, perlinPosScale, perlinValueY);
float Xvalue = rectTransform.anchoredPosition.x + rectTransform.anchoredPosition.y;
rectTransform.anchoredPosition += (new Vector2(valueX, valueY) - rectTransform.anchoredPosition) * smooth;
}
IEnumerator EndFade()
{
float time = 1;
@ -67,6 +87,7 @@ public class FlakeIcon : SnowFlake
public override void PlayAnimation()
{
State = IconState.Spwan;
rectTransform.anchoredPosition = Vector2.zero;
StartCoroutine(GoSpawn());
}

@ -0,0 +1,88 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class FlakePosition : MonoBehaviour
{
public static FlakePosition Instance;
[AutoUI] public bool View;
[AutoUI] public Vector2 Position1;
[AutoUI] public Vector2 Position2;
[AutoUI] public Vector2 Position3;
[AutoUI] public Vector2 Position4;
[AutoUI] public Vector2 Position5;
[AutoUI] public Vector2 Position6;
private RawImage[] imgs;
[SerializeField] private List<int> PositionSeed = new List<int>();
// Start is called before the first frame update
void Awake()
{
Instance = this;
imgs = GetComponentsInChildren<RawImage>();
for (int seed = 1;seed <= 6; seed++)
PositionSeed.Add(seed);
}
// Update is called once per frame
void Update()
{
if((Time.frameCount & 0x19) == 0)
{
SetImgEnable(View);
}
}
public void SetImgEnable(bool view)
{
for(int i = 0;i<imgs.Length;i++)
{
imgs[i].enabled = view;
imgs[i].rectTransform.anchoredPosition = GetPos(i + 1);
}
}
public int Take(out Vector2 pos)
{
var random = Random.Range(0, PositionSeed.Count);
var seed = PositionSeed[random];
Debug.Log(seed);
pos = GetPos(seed);
PositionSeed.RemoveAt(random);
return seed;
}
public void Put(int seed)
{
PositionSeed.Add(seed);
}
public Vector2 GetPos(int seed)
{
switch(seed)
{
case 1:
return Position1;
case 2:
return Position2;
case 3:
return Position3;
case 4:
return Position4;
case 5:
return Position5;
case 6:
return Position6;
}
return Vector2.zero;
}
}

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ad67b7a67ebbed24faf86849bf03e02f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -5,13 +5,16 @@ using UnityEngine.UI;
public class SnowFlakeBehaviour : MonoBehaviour
{
public bool Logo;
[AutoUI] public float Scale = 1;
[AutoUI] public int IconSize = 256;
[AutoUI] public int FlakeSize = 512;
[AutoUI] public Vector2 Position;
//[AutoUI] public Vector2 Position;
[AutoUI] public float DisappearTime = 5;
@ -30,7 +33,9 @@ public class SnowFlakeBehaviour : MonoBehaviour
public SnowFlake[] SnowFlakes;
[SerializeField] private SnowFlake _currentFlake;
private RectTransform _rectTransform;
public RectTransform _rectTransform;
private int positionSeed;
// Start is called before the first frame update
void Start()
@ -39,9 +44,11 @@ public class SnowFlakeBehaviour : MonoBehaviour
{
flake._snowFlakeBehaviour = this;
}
Play();
_colliderImage = _colliderRectTransform.GetComponent<RawImage>();
_rectTransform = GetComponent<RectTransform>();
positionSeed = 0;
Play();
}
// Update is called once per frame
@ -50,7 +57,7 @@ public class SnowFlakeBehaviour : MonoBehaviour
if((Time.frameCount & 0x19) == 0)
{
_colliderImage.color = ViewCollider ? Color.white : new Color(1,1,1,0);
_rectTransform.anchoredPosition = Position;
//_rectTransform.anchoredPosition = Position;
_rectTransform.localScale = Vector3.one * Scale;
}
@ -69,8 +76,6 @@ public class SnowFlakeBehaviour : MonoBehaviour
waitTime = Mathf.Max(0, waitTime);
Debug.Log(waitTime);
yield return new WaitForSeconds(waitTime);
Play();
@ -78,6 +83,14 @@ public class SnowFlakeBehaviour : MonoBehaviour
public void Play()
{
if(Logo == false)
{
if (positionSeed != 0)
FlakePosition.Instance.Put(positionSeed);
positionSeed = FlakePosition.Instance.Take(out var newPos);
_rectTransform.anchoredPosition = newPos;
}
_currentFlake = SnowFlakes[Random.Range(0, SnowFlakes.Length)];
Debug.Log(_currentFlake.gameObject.name);
_currentFlake.PlayAnimation();

@ -73,7 +73,6 @@ public class TouchArea : MonoBehaviour, IPointerDownHandler, IDragHandler, IPoin
{
if(result.gameObject == gameObject)
{
print($"trigger : {gameObject.name}");
RayHit.Invoke(pointerdata);
}
}
@ -110,7 +109,6 @@ public class TouchArea : MonoBehaviour, IPointerDownHandler, IDragHandler, IPoin
public void OnPointerExit(PointerEventData eventData)
{
Debug.Log("Exit:" + gameObject.name);
if (PointerExit == null)
return;
if (skip_on_mouse_only(eventData))
@ -120,7 +118,6 @@ public class TouchArea : MonoBehaviour, IPointerDownHandler, IDragHandler, IPoin
public void OnPointerEnter(PointerEventData eventData)
{
Debug.Log("Enter:" + gameObject.name);
if (PointerEnter == null)
return;
if (skip_on_mouse_only(eventData))

@ -13,7 +13,7 @@
"com.unity.purchasing": "2.0.6",
"com.unity.textmeshpro": "2.0.0",
"com.unity.timeline": "1.0.0",
"jp.keijiro.klak.spout": "file:<project>/../../../../../_Package/KlakSpout",
"jp.keijiro.klak.spout": "file:C:/Users/user/Desktop/Project-19050-Frozen2/_Develop/_Package/KlakSpout",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",

@ -1,86 +1,101 @@
{
"SceneCamera/Canvas/Flake1/Scale": 1.0,
"SceneCamera/Canvas/Flake1/Position": [
-500.0,
200.0
],
"SceneCamera/Canvas/Flake1/IconSize": 256,
"SceneCamera/Canvas/Flake1/FlakeSize": 512,
"SceneCamera/Canvas/Flake1/DisappearTime": 5.0,
"SceneCamera/Canvas/Flake1/DisappearTimeRandomRange": 2.0,
"SceneCamera/Canvas/Flake1/ViewCollider": false,
"SceneCamera/Canvas/Flake1/ColliderPosition": [
460.0,
0.0,
0.0
],
"SceneCamera/Canvas/Flake1/ColliderSize": [
400.0,
400.0
256.0,
256.0
],
"SceneCamera/Canvas/Flake2/Scale": 1.0,
"SceneCamera/Canvas/Flake2/Position": [
500.0,
200.0
],
"SceneCamera/Canvas/Flake2/IconSize": 256,
"SceneCamera/Canvas/Flake2/FlakeSize": 512,
"SceneCamera/Canvas/Flake2/DisappearTime": 5.0,
"SceneCamera/Canvas/Flake2/DisappearTimeRandomRange": 2.0,
"SceneCamera/Canvas/Flake2/ViewCollider": false,
"SceneCamera/Canvas/Flake2/ColliderPosition": [
460.0,
0.0,
0.0
],
"SceneCamera/Canvas/Flake2/ColliderSize": [
400.0,
400.0
256.0,
256.0
],
"SceneCamera/Canvas/Flake3/Scale": 1.0,
"SceneCamera/Canvas/Flake3/Position": [
500.0,
-200.0
],
"SceneCamera/Canvas/Flake3/IconSize": 256,
"SceneCamera/Canvas/Flake3/FlakeSize": 512,
"SceneCamera/Canvas/Flake3/DisappearTime": 5.0,
"SceneCamera/Canvas/Flake3/DisappearTimeRandomRange": 2.0,
"SceneCamera/Canvas/Flake3/ViewCollider": false,
"SceneCamera/Canvas/Flake3/ColliderPosition": [
460.0,
0.0,
0.0
],
"SceneCamera/Canvas/Flake3/ColliderSize": [
400.0,
400.0
256.0,
256.0
],
"SceneCamera/Canvas/Flake4/Scale": 1.0,
"SceneCamera/Canvas/Flake4/Position": [
-500.0,
-200.0
],
"SceneCamera/Canvas/Flake4/IconSize": 256,
"SceneCamera/Canvas/Flake4/FlakeSize": 512,
"SceneCamera/Canvas/Flake4/DisappearTime": 5.0,
"SceneCamera/Canvas/Flake4/DisappearTimeRandomRange": 2.0,
"SceneCamera/Canvas/Flake4/ViewCollider": false,
"SceneCamera/Canvas/Flake4/ColliderPosition": [
460.0,
0.0,
0.0
],
"SceneCamera/Canvas/Flake4/ColliderSize": [
400.0,
400.0
256.0,
256.0
],
"SceneCamera/Canvas/FlakeLogo/Scale": 1.0,
"SceneCamera/Canvas/FlakeLogo/Position": [
0.0,
0.0
],
"SceneCamera/Canvas/FlakeLogo/IconSize": 256,
"SceneCamera/Canvas/FlakeLogo/FlakeSize": 512,
"SceneCamera/Canvas/FlakeLogo/DisappearTime": 5.0,
"SceneCamera/Canvas/FlakeLogo/DisappearTimeRandomRange": 2.0,
"SceneCamera/Canvas/FlakeLogo/ViewCollider": false,
"SceneCamera/Canvas/FlakeLogo/ColliderPosition": [
460.0,
0.0,
0.0
],
"SceneCamera/Canvas/FlakeLogo/ColliderSize": [
400.0,
400.0
256.0,
256.0
],
"SpoutCamera/Canvas/Pointer/Visible": true,
"SpoutCamera/Canvas/Pointer/PointSize": 256,
"SpoutCamera/Canvas/FlakePosition/View": false,
"SpoutCamera/Canvas/FlakePosition/Position1": [
-500.0,
0.0
],
"SpoutCamera/Canvas/FlakePosition/Position2": [
-250.0,
-300.0
],
"SpoutCamera/Canvas/FlakePosition/Position3": [
250.0,
-300.0
],
"SpoutCamera/Canvas/FlakePosition/Position4": [
500.0,
0.0
],
"SpoutCamera/Canvas/FlakePosition/Position5": [
250.0,
300.0
],
"SpoutCamera/Canvas/FlakePosition/Position6": [
-250.0,
300.0
],
"ParticleCamera/ParticlePool/GroupCount": 5,
"ParticleCamera/ParticlePool/ParticleAmount": 1
}

@ -308,6 +308,7 @@ GameObject:
m_Component:
- component: {fileID: 388490436}
- component: {fileID: 388490435}
- component: {fileID: 388490437}
m_Layer: 0
m_Name: StatManager
m_TagString: Untagged
@ -328,11 +329,12 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
fade_sec: 1
loop_to_trigger: 4
loop_to_trigger: 1
idle_player: {fileID: 540220394}
h_player: {fileID: 1232323602}
h_grp: {fileID: 229700563}
s_grp: {fileID: 1191269363}
horse_clip: {fileID: 8300000, guid: 10adc664ed6fa7641bc9be8e020216cf, type: 3}
--- !u!4 &388490436
Transform:
m_ObjectHideFlags: 0
@ -347,6 +349,102 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!82 &388490437
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 388490434}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: 1320bfe591757af4ca58ba59f1dda347, type: 3}
m_PlayOnAwake: 1
m_Volume: 1
m_Pitch: 1
Loop: 1
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!1001 &472923654
PrefabInstance:
m_ObjectHideFlags: 0
@ -767,9 +865,10 @@ MonoBehaviour:
m_EditorClassIdentifier:
img: {fileID: 2829506254029656376, guid: 8bbc036a3be21954681613cbe4f0e9a8, type: 3}
canvas: {fileID: 1191269362}
VisualizeTouches: 1
frame_gap: 10
VisualizeTouches: 0
frame_gap: 30
delta_threshold: 100
snow_size: 256
img_fade_speed: 0.02
img_wait_sec: 2
audio_volume: 1

@ -20,10 +20,16 @@ public class StatManager : MonoBehaviour
public DShowMoviePlayer h_player;
public CanvasGroup h_grp;
public CanvasGroup s_grp;
public AudioClip horse_clip;
AudioSource aud;
int loop_count;
float h_lerp_val;
float s_lerp_val;
float h_total_time = 30f;
float i_total_time = 8f;
float trigger_time;
float m_timer;
void Start()
{
@ -31,26 +37,28 @@ public class StatManager : MonoBehaviour
loop_count = 0;
h_lerp_val = 0f;
s_lerp_val = 1f;
// m_timer = h_total_time;
m_timer = 0f;
}
void Update()
{
if(h_player.IsPlaying == false){
if (idle_player.Frame == idle_player.TotalNumFrames)
{
loop_count += 1;
trigger_time = i_total_time * loop_to_trigger;
//if(h_player.IsPlaying == falss)
m_timer += Time.deltaTime;
//Debug.Log(m_timer);
//if(h_player.IsPlaying == false){
//if (idle_player.Frame == idle_player.TotalNumFrames)
//{
// loop_count += 1;
//Debug.Log(loop_count);
}
if (loop_count >= loop_to_trigger)
{
Debug.Log("horse fade in");
h_player.Play();
StartCoroutine("h_fade_in");
loop_count = 0;
}
}
//}
//if (loop_count >= loop_to_trigger)
else
//if (h_player.IsPlaying)
/*if (false)
{
if(h_player.GetCurrentTime == 18f)
{
@ -64,18 +72,53 @@ public class StatManager : MonoBehaviour
StartCoroutine("s_fade_in");
}
if(h_player.Frame == h_player.TotalNumFrames - fade_sec * 30)
if(h_player.GetCurrentTime > h_total_time - fade_sec)
{
idle_player.Frame = 0;
//idle_player.Frame = 0;
Debug.Log("horse fade out");
StartCoroutine("h_fade_out");
}
}*/
if(m_timer > trigger_time + h_total_time)
{
m_timer = 0f;
}
else if (m_timer > trigger_time + h_total_time - fade_sec)
{
Debug.Log("horse fade out");
StartCoroutine("h_fade_out");
}
else if (m_timer > trigger_time + 27f)
{
Debug.Log("snow in");
StartCoroutine("s_fade_in");
}
else if (m_timer > trigger_time + 18f)
{
Debug.Log("snow out");
StartCoroutine("s_fade_out");
}
else if (m_timer > trigger_time)
{
aud = gameObject.AddComponent<AudioSource>();
aud.loop = false;
aud.playOnAwake = false;
aud.clip = horse_clip;
aud.Play();
h_player.Play();
//m_timer = 0f;
Debug.Log("horse fade in");
StartCoroutine("h_fade_in");
loop_count = 0;
}
}
IEnumerator h_fade_in()
{
h_lerp_val = 0f;
//h_lerp_val = 0f;
while (h_grp.alpha < 1f)
{
h_lerp_val += Time.deltaTime / fade_sec;
@ -87,19 +130,20 @@ public class StatManager : MonoBehaviour
IEnumerator h_fade_out()
{
h_lerp_val = 1f;
//h_lerp_val = 1f;
while (h_grp.alpha > 0f)
{
h_lerp_val -= Time.deltaTime / fade_sec;
h_grp.alpha = Mathf.Lerp(0f, 1f, h_lerp_val);
yield return null;
}
Destroy(aud);
yield break;
}
IEnumerator s_fade_in()
{
s_lerp_val = 0f;
//s_lerp_val = 0f;
while (s_grp.alpha < 1f)
{
s_lerp_val += Time.deltaTime*2f;
@ -111,7 +155,7 @@ public class StatManager : MonoBehaviour
IEnumerator s_fade_out()
{
s_lerp_val = 1f;
//s_lerp_val = 1f;
while (s_grp.alpha > 0f)
{
s_lerp_val -= Time.deltaTime*2f;

@ -15,16 +15,19 @@ public class movieController : MonoBehaviour
public bool force_destroy;
public float destroy_timer;
public float wait_sec = 2f;
public float volume = 1f;
//public float volume = 1f;
public Vector2 size;
public DShowClip snow_01;
public DShowClip snow_02;
public DShowClip snow_03;
public DShowClip snow_04;
/*
public AudioClip step1;
public AudioClip step2;
public AudioClip step3;
public AudioClip step4;
*/
bool playAud;
float alpha;
@ -45,13 +48,15 @@ public class movieController : MonoBehaviour
void Update()
{
aud.volume = volume;
if (playAud && aud.clip != null)
//aud.volume = volume;
GetComponent<RectTransform>().sizeDelta = size;
/*if (playAud && aud.clip != null)
{
Debug.Log(aud.clip.name);
aud.Play();
playAud = false;
}
}*/
if(stat == 0){
alpha = 0;
if (player.IsPlaying)
@ -89,28 +94,28 @@ public class movieController : MonoBehaviour
void OnEnable()
{
aud = gameObject.AddComponent<AudioSource>();
//aud = gameObject.AddComponent<AudioSource>();
int seed = Random.Range(0, 4);
switch (seed){
case 0:
player.VideoAsset = snow_01;
aud.clip = step1;
//aud.clip = step1;
break;
case 1:
player.VideoAsset = snow_02;
aud.clip = step2;
//aud.clip = step2;
break;
case 2:
player.VideoAsset = snow_03;
aud.clip = step3;
//aud.clip = step3;
break;
case 3:
player.VideoAsset = snow_04;
aud.clip = step4;
//aud.clip = step4;
break;
}
//aud.Play();
playAud = true;
//playAud = true;
if (name != "RawImage") {

@ -12,7 +12,7 @@ public class tuio_event : MonoBehaviour
Dictionary<int, Vector2> pre_pos = new Dictionary<int, Vector2>();
[Config]
public bool VisualizeTouches = true;
public bool VisualizeTouches = false;
[Config]
[Range(1, 30)]
@ -22,6 +22,10 @@ public class tuio_event : MonoBehaviour
[Range(50, 300)]
public int delta_threshold = 100;
[Config]
[Range(128, 1024)]
public int snow_size = 256;
[Config]
[Range(0.01f, 0.1f)]
public float img_fade_speed = 0.02f;
@ -31,8 +35,8 @@ public class tuio_event : MonoBehaviour
public float img_wait_sec = 2f;
//[Config]
[Range(0f, 1f)]
public float audio_volume = 1f;
//[Range(0f, 1f)]
//public float audio_volume = 1f;
void Update()
{
@ -41,7 +45,6 @@ public class tuio_event : MonoBehaviour
var touches = TUIOManager.Instance.touches;
foreach (var id in touches.Keys)
{
movieController movie = null;
if (movies.ContainsKey(id) == false) // Add
{
@ -51,7 +54,8 @@ public class tuio_event : MonoBehaviour
movie = g.AddComponent<movieController>();
movie.fade_speed = img_fade_speed;
movie.wait_sec = img_wait_sec;
movie.volume = audio_volume;
movie.size = new Vector2(snow_size, snow_size);
//movie.volume = audio_volume;
movie.id = id;
movies.Add(id, movie);
var rt = movie.transform as RectTransform;
@ -68,6 +72,7 @@ public class tuio_event : MonoBehaviour
var rt = movie.transform as RectTransform;
//rt.anchoredPosition = touches[id].position;
float delta_pos = Vector2.Distance(pre_pos[id], rt.anchoredPosition);
//Debug.Log(delta_pos);
if (delta_pos > delta_threshold)
{
movie.force_destroy = true;

Loading…
Cancel
Save