add vfx controller & post alpha function

master
tigerchen 6 years ago
parent 81a2f773bc
commit 3c1327e57b
  1. 48
      01_ForstCoronation/Unity-19050-01_ForstCoronation/19050-01_ForstCoronation/Assets/Scenes/Ice.unity
  2. 56
      01_ForstCoronation/Unity-19050-01_ForstCoronation/19050-01_ForstCoronation/Assets/Scripts/DebugUI.cs
  3. 2
      01_ForstCoronation/Unity-19050-01_ForstCoronation/19050-01_ForstCoronation/Assets/Scripts/PostProcessController.cs
  4. 80
      01_ForstCoronation/Unity-19050-01_ForstCoronation/19050-01_ForstCoronation/Assets/Scripts/VFXController.cs
  5. 11
      01_ForstCoronation/Unity-19050-01_ForstCoronation/19050-01_ForstCoronation/Assets/Scripts/VFXController.cs.meta
  6. 6795
      01_ForstCoronation/Unity-19050-01_ForstCoronation/19050-01_ForstCoronation/Assets/Visual Effect Graphs/iceVFX_2018.vfx

@ -623,6 +623,11 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b5cf9d5827877014ba6331a64e1b4fe2, type: 3} m_Script: {fileID: 11500000, guid: b5cf9d5827877014ba6331a64e1b4fe2, type: 3}
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
post_exposure: -0.6
contrast: 100
saturation: -20
bloom_intensity: 1
bloom_threshold: 0.6
vignette_intensity: 0.3 vignette_intensity: 0.3
--- !u!82 &590248852 --- !u!82 &590248852
AudioSource: AudioSource:
@ -1156,6 +1161,7 @@ GameObject:
- component: {fileID: 1090188931} - component: {fileID: 1090188931}
- component: {fileID: 1090188930} - component: {fileID: 1090188930}
- component: {fileID: 1090188929} - component: {fileID: 1090188929}
- component: {fileID: 1090188933}
m_Layer: 0 m_Layer: 0
m_Name: iceVFX_2018 m_Name: iceVFX_2018
m_TagString: Untagged m_TagString: Untagged
@ -1217,6 +1223,12 @@ VisualEffect:
m_PropertySheet: m_PropertySheet:
m_Float: m_Float:
m_Array: m_Array:
- m_Value: 0
m_Name: flake_alpha
m_Overridden: 0
- m_Value: 0
m_Name: ground_post_alpha
m_Overridden: 0
- m_Value: 0 - m_Value: 0
m_Name: Lerp_Val m_Name: Lerp_Val
m_Overridden: 0 m_Overridden: 0
@ -1355,10 +1367,34 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
m_ExecuteInEditor: 1 m_ExecuteInEditor: 1
m_Bindings: m_Bindings:
- {fileID: 1090188931}
- {fileID: 1090188929} - {fileID: 1090188929}
- {fileID: 1090188931}
- {fileID: 1090188930} - {fileID: 1090188930}
m_VisualEffect: {fileID: 1090188927} m_VisualEffect: {fileID: 1090188927}
--- !u!114 &1090188933
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1090188925}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b0666279b99caa841a5f3282a76f3c7f, type: 3}
m_Name:
m_EditorClassIdentifier:
lifetime: 5
ground_ice_spawn_rate: 30000
ground_flake_spawn_rate: 5000
flying_flake_spawn_rate: 1000
min_frost_size: 0.3
max_frost_size: 0.5
min_spike_size: 0.1
max_spike_size: 0.3
min_flake_size: 0
max_flake_size: 0.1
ground_post_alpha: 0
flake_alpha: 1
--- !u!1 &1216109995 --- !u!1 &1216109995
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1813,16 +1849,6 @@ MonoBehaviour:
Target_x: -3 Target_x: -3
growing_speed: 0.008 growing_speed: 0.008
delay_sec: 2 delay_sec: 2
vfx_lifetime: 5
vfx_ground_ice_spawn_rate: 30000
vfx_ground_flake_spawn_rate: 1500
vfx_flying_flake_spawn_rate: 1000
vfx_min_frost_size: 0.3
vfx_max_frost_size: 0.5
vfx_min_spike_size: 0.1
vfx_max_spike_size: 0.3
vfx_min_flake_size: 0
vfx_max_flake_size: 0.1
--- !u!4 &1482770261 --- !u!4 &1482770261
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

@ -33,46 +33,6 @@ public class DebugUI : MonoBehaviour
[Range(0, 5)] [Range(0, 5)]
public int delay_sec = 2; public int delay_sec = 2;
[Config]
[Range(1, 10)]
public int vfx_lifetime = 5;
[Config]
[Range(10000, 60000)]
public int vfx_ground_ice_spawn_rate = 30000;
[Config]
[Range(1000, 10000)]
public int vfx_ground_flake_spawn_rate = 5000;
[Config]
[Range(100, 3000)]
public int vfx_flying_flake_spawn_rate = 1000;
[Config]
[Range(0.1f, 0.8f)]
public float vfx_min_frost_size = 0.3f;
[Config]
[Range(0.3f, 1f)]
public float vfx_max_frost_size = 0.5f;
[Config]
[Range(0.01f, 0.5f)]
public float vfx_min_spike_size = 0.1f;
[Config]
[Range(0.1f, 1f)]
public float vfx_max_spike_size = 0.3f;
[Config]
[Range(0f, 0.1f)]
public float vfx_min_flake_size = 0f;
[Config]
[Range(0.05f, 0.3f)]
public float vfx_max_flake_size = 0.1f;
float lerp_val; float lerp_val;
Vector3 final_pos; Vector3 final_pos;
bool showObject; bool showObject;
@ -106,8 +66,6 @@ public class DebugUI : MonoBehaviour
} }
} }
updateVFX();
if (Input.GetKeyDown(KeyCode.F1)) if (Input.GetKeyDown(KeyCode.F1))
{ {
debugMode = !debugMode; debugMode = !debugMode;
@ -216,18 +174,4 @@ public class DebugUI : MonoBehaviour
bool _stat = button.GetComponentInParent<Button>().interactable; bool _stat = button.GetComponentInParent<Button>().interactable;
button.GetComponentInParent<Button>().interactable = !_stat; button.GetComponentInParent<Button>().interactable = !_stat;
} }
void updateVFX()
{
vfx.SetInt("lifetime", vfx_lifetime);
vfx.SetInt("ground_ice_spawn_rate", vfx_ground_ice_spawn_rate);
vfx.SetInt("ground_flake_spawn_rate", vfx_ground_flake_spawn_rate);
vfx.SetInt("flying_flake_spawn_rate", vfx_flying_flake_spawn_rate);
vfx.SetFloat("min_frost_size", vfx_min_frost_size);
vfx.SetFloat("max_frost_size", vfx_max_frost_size);
vfx.SetFloat("min_spike_size", vfx_min_spike_size);
vfx.SetFloat("max_spike_size", vfx_max_spike_size);
vfx.SetFloat("min_flake_size", vfx_min_flake_size);
vfx.SetFloat("max_flake_size", vfx_max_flake_size);
}
} }

@ -19,7 +19,7 @@ public class PostProcessController : MonoBehaviour
public float saturation = -20f; public float saturation = -20f;
[Config] [Config]
[Range(0, 1f)] [Range(0, 3f)]
public float bloom_intensity = 1f; public float bloom_intensity = 1f;
[Config] [Config]

@ -0,0 +1,80 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.VFX;
using UltraCombos.Configuration;
public class VFXController : MonoBehaviour
{
[Config]
[Range(1, 10)]
public int lifetime = 5;
[Config]
[Range(10000, 60000)]
public int ground_ice_spawn_rate = 30000;
[Config]
[Range(1000, 10000)]
public int ground_flake_spawn_rate = 5000;
[Config]
[Range(100, 3000)]
public int flying_flake_spawn_rate = 1000;
[Config]
[Range(0.1f, 0.8f)]
public float min_frost_size = 0.3f;
[Config]
[Range(0.3f, 1f)]
public float max_frost_size = 0.5f;
[Config]
[Range(0.01f, 0.5f)]
public float min_spike_size = 0.1f;
[Config]
[Range(0.1f, 1f)]
public float max_spike_size = 0.3f;
[Config]
[Range(0f, 0.1f)]
public float min_flake_size = 0f;
[Config]
[Range(0.05f, 0.3f)]
public float max_flake_size = 0.1f;
[Config]
[Range(-1f, 1f)]
public float ground_post_alpha = 0f;
[Config]
[Range(0f, 1f)]
public float flake_alpha = 1f;
VisualEffect vfx;
void Start()
{
vfx = GetComponent<VisualEffect>();
}
// Update is called once per frame
void Update()
{
vfx.SetInt("lifetime", lifetime);
vfx.SetInt("ground_ice_spawn_rate", ground_ice_spawn_rate);
vfx.SetInt("ground_flake_spawn_rate", ground_flake_spawn_rate);
vfx.SetInt("flying_flake_spawn_rate", flying_flake_spawn_rate);
vfx.SetFloat("min_frost_size", min_frost_size);
vfx.SetFloat("max_frost_size", max_frost_size);
vfx.SetFloat("min_spike_size", min_spike_size);
vfx.SetFloat("max_spike_size", max_spike_size);
vfx.SetFloat("min_flake_size", min_flake_size);
vfx.SetFloat("max_flake_size", max_flake_size);
vfx.SetFloat("ground_post_alpha", ground_post_alpha);
vfx.SetFloat("flake_alpha", flake_alpha);
}
}

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