add configuration & camera controller

master
tigerchen 6 years ago
parent ce8cccbf1d
commit 49ed502ae6
  1. 60
      Unity-19050-01_ForstCoronation/Assets/Scenes/Ice.unity
  2. 42
      Unity-19050-01_ForstCoronation/Assets/Scripts/CameraController.cs
  3. 28
      Unity-19050-01_ForstCoronation/Assets/Scripts/DebugUI.cs
  4. 3134
      Unity-19050-01_ForstCoronation/Assets/Visual Effect Graphs/iceVFX_2018.vfx

@ -371,7 +371,7 @@ RectTransform:
- {fileID: 1269857429}
- {fileID: 1048552606}
m_Father: {fileID: 0}
m_RootOrder: 12
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -464,7 +464,6 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 590248849}
- component: {fileID: 590248855}
- component: {fileID: 590248848}
- component: {fileID: 590248847}
- component: {fileID: 590248850}
@ -472,6 +471,7 @@ GameObject:
- component: {fileID: 590248852}
- component: {fileID: 590248853}
- component: {fileID: 590248854}
- component: {fileID: 590248855}
m_Layer: 8
m_Name: 01FrostCamera
m_TagString: MainCamera
@ -556,7 +556,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Version: 1
clearColorMode: 0
clearColorMode: 1
backgroundColorHDR: {r: 0.025, g: 0.07, b: 0.19, a: 0}
clearDepth: 1
renderingPath: 0
@ -635,7 +635,7 @@ AudioSource:
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 0}
m_PlayOnAwake: 1
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
Loop: 0
@ -806,37 +806,12 @@ MonoBehaviour:
m_GameObject: {fileID: 590248846}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e8a636f62116c0a40bbfefdf876d4608, type: 3}
m_Script: {fileID: 11500000, guid: e3690c34aff288d4d9b9a4d84bc7504a, type: 3}
m_Name:
m_EditorClassIdentifier:
boost: 3.5
positionLerpTime: 0.2
mouseSensitivityCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0.5
inSlope: 0
outSlope: 5
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 1
value: 2.5
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
rotationLerpTime: 0.01
invertY: 0
cam_x: 0
cam_y: 8
key_movement: 0.1
--- !u!1 &706372899
GameObject:
m_ObjectHideFlags: 0
@ -1077,7 +1052,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 10
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0}
--- !u!1 &1048552605
GameObject:
@ -1292,7 +1267,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 11
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1090188929
MonoBehaviour:
@ -1353,8 +1328,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_ExecuteInEditor: 1
m_Bindings:
- {fileID: 1090188929}
- {fileID: 1090188930}
- {fileID: 1090188929}
- {fileID: 1090188931}
m_VisualEffect: {fileID: 1090188927}
--- !u!1 &1216109995
@ -1809,10 +1784,9 @@ MonoBehaviour:
stat:
Emitter_x: 3.5
Target_x: -3
Common_z: 0
growingSpeed: 0.008
fadeSpeed: 15
smooth: 0.3
growing_speed: 0.008
delay_sec: 2
lifetime: 5
--- !u!4 &1482770261
Transform:
m_ObjectHideFlags: 0
@ -1825,7 +1799,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1674836082
GameObject:
@ -1855,7 +1829,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &1840994726
PrefabInstance:
@ -1898,7 +1872,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_RootOrder
value: 8
value: 7
objectReference: {fileID: 0}
- target: {fileID: 4601478661674938, guid: 6143453941a05b54582f835773a10d58, type: 3}
propertyPath: m_LocalEulerAnglesHint.x

@ -0,0 +1,42 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UltraCombos.Configuration;
public class CameraController : MonoBehaviour
{
[Config]
[Range(-5f, 5f)]
public float cam_x;
[Config]
[Range(5f, 10f)]
public float cam_y = 8f;
[Config]
[Range(0.05f, 0.5f)]
public float key_movement = 0.1f;
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.A))
{
cam_x -= key_movement;
}
else if (Input.GetKeyDown(KeyCode.D))
{
cam_x += key_movement;
}
else if (Input.GetKeyDown(KeyCode.W))
{
cam_y += key_movement;
}
else if (Input.GetKeyDown(KeyCode.S))
{
cam_y -= key_movement;
}
GetComponent<Transform>().position = new Vector3(cam_x, cam_y, 0);
}
}

@ -25,21 +25,17 @@ public class DebugUI : MonoBehaviour
[Range(-5f, 0f)]
public float Target_x = -2.5f;
[Config]
[Range(-3f, 3f)]
public float Common_z = 0f;
[Config]
[Range(0f, 0.05f)]
public float growingSpeed;
public float growing_speed = 0.008f;
[Config]
[Range(10, 30)]
public float fadeSpeed;
[Range(0, 5)]
public int delay_sec = 2;
[Config]
[Range(0f, 0.5f)]
public float smooth;
[Range(1, 10)]
public int lifetime = 5;
float lerp_val;
Vector3 final_pos;
@ -97,25 +93,25 @@ public class DebugUI : MonoBehaviour
if(stat == "growing")
{
lerp_val += growingSpeed;
lerp_val += growing_speed;
if(lerp_val >= 1)
{
lerp_val = 1;
stat = "completed";
StartCoroutine("sendCompleted");
Invoke("setButtonInteractable", 1);
Invoke("setButtonInteractable", delay_sec);
button.GetComponent<Text>().text = stat;
Debug.Log(stat);
}
}
else if(stat == "vanishing")
{
lerp_val -= growingSpeed;
lerp_val -= growing_speed;
if(lerp_val <= 0)
{
lerp_val = 0;
stat = "wait";
Invoke("setButtonInteractable", 1);
Invoke("setButtonInteractable", delay_sec);
button.GetComponent<Text>().text = stat;
Debug.Log(stat);
}
@ -126,8 +122,8 @@ public class DebugUI : MonoBehaviour
Transform base_trans = baseEmitter.GetComponent<Transform>();
Transform targ_trans = target.GetComponent<Transform>();
base_trans.position = new Vector3(Emitter_x, 0, Common_z);
targ_trans.position = new Vector3(Target_x, 0, Common_z);
baseEmitter.transform.position = new Vector3(Emitter_x, 0, 0);
targ_trans.position = new Vector3(Target_x, 0, 0);
emitter.GetComponent<Transform>().position = Vector3.Lerp(base_trans.position, targ_trans.position, lerp_val);
}
@ -185,6 +181,6 @@ public class DebugUI : MonoBehaviour
void updateVFX()
{
vfx.SetInt("lifetime", lifetime);
}
}

Loading…
Cancel
Save