using UnityEngine; using System.Collections; public class shakecameraControl : MonoBehaviour { private float time=0f; public float StartTime = 0.7f; private float Time0; public float shaketime = 0.3f; public float shakeInt; public bool end = false; // Use this for initialization void Start () { } private void OnEnable() { Time0 = 0f; time = 0f; end = false; } private void OnDisable() { } // Update is called once per frame void Update () { if (!end) { time += Time.deltaTime; if (time >= StartTime) { Time0+=Time.deltaTime; SC_shakeCamera.shakeCamera(shakeInt); if (Time0>=shaketime) { end = true; } } } } }