random ice & fix video flickering

master
tigerchen 6 years ago
parent 3092d89fe1
commit e6ea093483
  1. 20
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Prefabs/FlakeImage.prefab
  2. 0
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Prefabs/FlakeImage.prefab.meta
  3. 8
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scenes/DarkSea.unity
  4. 1
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/StatManager.cs
  5. 36
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Scripts/movieController.cs
  6. 2
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/BG.DShowClip.asset
  7. 2
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/Horse.DShowClip.asset
  8. 17
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/snow_01.DShowClip.asset
  9. 8
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/snow_01.DShowClip.asset.meta
  10. 17
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/snow_02.DShowClip.asset
  11. 8
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/snow_02.DShowClip.asset.meta
  12. 17
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/snow_03.DShowClip.asset
  13. 8
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/snow_03.DShowClip.asset.meta
  14. 17
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/snow_04.DShowClip.asset
  15. 8
      08_DarkSea/Unity-19050-08-DarkSea/19050-08-DarkSea/Assets/Videos/snow_04.DShowClip.asset.meta

@ -15,7 +15,7 @@ GameObject:
- component: {fileID: 1996081109}
- component: {fileID: 1996081110}
m_Layer: 5
m_Name: RawImage
m_Name: FlakeImage
m_TagString: onFoot
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -38,7 +38,7 @@ RectTransform:
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 200, y: 200}
m_SizeDelta: {x: 256, y: 256}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2142686115215515799
CanvasRenderer:
@ -86,11 +86,15 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
id: 0
fade_speed: 0.05
stat: 0
alpha: 0
fade_speed: 0.05
force_destroy: 0
destroy_timer: 0
CanDsetroy: 0
wait_sec: 2
snow_01: {fileID: 11400000, guid: 58421c5bb11f5a841a368be3400d5c2b, type: 2}
snow_02: {fileID: 11400000, guid: f3829d3dc90b3db46a706d2efb7cd1dd, type: 2}
snow_03: {fileID: 11400000, guid: f39b8c9e311ce0a429923c3eef0402b7, type: 2}
snow_04: {fileID: 11400000, guid: 39bb304109cba704492efa5099cc1856, type: 2}
--- !u!114 &1996081109
MonoBehaviour:
m_ObjectHideFlags: 0
@ -119,8 +123,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 10f07b3f9fb96524db93eb42d89c229c, type: 3}
m_Name:
m_EditorClassIdentifier:
VideoAsset: {fileID: 11400000, guid: 232980c200b699741a54e99e165d86a2, type: 2}
VideoAsset: {fileID: 11400000, guid: 58421c5bb11f5a841a368be3400d5c2b, type: 2}
LoadOnAwake: 1
PlayOnStart: 1
Looping: 1
PlayOnStart: 0
Looping: 0
AudioVolume: 0

@ -146,7 +146,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 1000, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 2528, y: 2400}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &229700561
@ -212,7 +212,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
fade_sec: 1
loop_to_trigger: 1
loop_to_trigger: 4
idle_player: {fileID: 540220394}
h_player: {fileID: 1232323602}
h_grp: {fileID: 1781519744}
@ -264,7 +264,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -1260, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 2528, y: 2400}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &503604497
@ -756,7 +756,7 @@ MonoBehaviour:
img: {fileID: 2829506254029656376, guid: 8bbc036a3be21954681613cbe4f0e9a8, type: 3}
canvas: {fileID: 798465533}
VisualizeTouches: 1
frame_gap: 20
frame_gap: 10
delta_threshold: 100
img_fade_speed: 0.02
img_wait_sec: 2

@ -36,6 +36,7 @@ public class StatManager : MonoBehaviour
if (idle_player.Frame == idle_player.TotalNumFrames)
{
loop_count += 1;
Debug.Log(loop_count);
}
if (loop_count >= loop_to_trigger)
{

@ -14,12 +14,16 @@ public class movieController : MonoBehaviour
public bool force_destroy;
public float destroy_timer;
public float wait_sec = 2f;
public DShowClip snow_01;
public DShowClip snow_02;
public DShowClip snow_03;
public DShowClip snow_04;
float alpha;
void Awake()
{
player = GetComponent<DShowMoviePlayer>();
stat = 1;
stat = 0;
force_destroy = false;
}
@ -31,20 +35,23 @@ public class movieController : MonoBehaviour
void Update()
{
if(stat == 0){
alpha = 0;
stat = 1;
if (player.IsPlaying)
stat = 1;
}
else if (stat == 1)
{
alpha += fade_speed;
alpha += fade_speed * 5f;
if (alpha >= 1)
{
alpha = 1;
stat = 2;
}
}
else if (stat == 2 && force_destroy)
else
if (stat == 2 && force_destroy)
{
stat = 3;
}
@ -60,22 +67,38 @@ public class movieController : MonoBehaviour
Destroy(this.gameObject);
}
}
}
GetComponent<RawImage>().color = new Color(1f, 1f, 1f, alpha);
}
void OnEnable()
{
int seed = Random.Range(0, 4);
switch (seed){
case 0:
player.VideoAsset = snow_01;
break;
case 1:
player.VideoAsset = snow_02;
break;
case 2:
player.VideoAsset = snow_03;
break;
case 3:
player.VideoAsset = snow_04;
break;
}
if (name != "RawImage") {
GetComponent<RawImage>().enabled = true;
}
//Debug.Log("Hi");
stat = 1;
stat = 0;
alpha = 0f;
rotateImg();
player.Play();
}
void OnDestroy()
@ -89,5 +112,6 @@ public class movieController : MonoBehaviour
Vector3 mid_pt = new Vector3(GetComponent<RectTransform>().position.x, GetComponent<RectTransform>().position.y, 0);
float rand_deg = Random.Range(0, 360);
GetComponent<RectTransform>().Rotate(rot_axis, rand_deg);
}
}

@ -13,5 +13,5 @@ MonoBehaviour:
m_Name: BG.DShowClip
m_EditorClassIdentifier:
m_VideoLocation: 1
m_VideoPath: ..\..\..\..\_Deploy_PC\08_DarkSea\Build-19050-08_DarkSea\Material\Frozen2_DarkSea_test_hap.avi
m_VideoPath: ..\..\..\..\_Deploy_PC\08_DarkSea\Build-19050-08_DarkSea\Material\darksea_loop.avi
animationClip: {fileID: 0}

@ -13,5 +13,5 @@ MonoBehaviour:
m_Name: Horse.DShowClip
m_EditorClassIdentifier:
m_VideoLocation: 1
m_VideoPath: ..\..\..\..\_Deploy_PC\08_DarkSea\Build-19050-08_DarkSea\Material\Frozen2_DarkSea_test_hap.avi
m_VideoPath: ..\..\..\..\_Deploy_PC\08_DarkSea\Build-19050-08_DarkSea\Material\darksea_nokk_2.avi
animationClip: {fileID: 0}

@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b7eca376a120a0e49a97afa024778843, type: 3}
m_Name: snow_01.DShowClip
m_EditorClassIdentifier:
m_VideoLocation: 1
m_VideoPath: ..\..\..\..\_Deploy_PC\08_DarkSea\Build-19050-08_DarkSea\Material\snow_01.avi
animationClip: {fileID: 0}

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 58421c5bb11f5a841a368be3400d5c2b
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b7eca376a120a0e49a97afa024778843, type: 3}
m_Name: snow_02.DShowClip
m_EditorClassIdentifier:
m_VideoLocation: 1
m_VideoPath: ..\..\..\..\_Deploy_PC\08_DarkSea\Build-19050-08_DarkSea\Material\snow_02.avi
animationClip: {fileID: 0}

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

@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b7eca376a120a0e49a97afa024778843, type: 3}
m_Name: snow_03.DShowClip
m_EditorClassIdentifier:
m_VideoLocation: 1
m_VideoPath: ..\..\..\..\_Deploy_PC\08_DarkSea\Build-19050-08_DarkSea\Material\snow_03.avi
animationClip: {fileID: 0}

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

@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b7eca376a120a0e49a97afa024778843, type: 3}
m_Name: snow_04.DShowClip
m_EditorClassIdentifier:
m_VideoLocation: 1
m_VideoPath: ..\..\..\..\_Deploy_PC\08_DarkSea\Build-19050-08_DarkSea\Material\snow_04.avi
animationClip: {fileID: 0}

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 39bb304109cba704492efa5099cc1856
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
Loading…
Cancel
Save