예제 #1
0
    public CameraShakeEffect ShakeEffect(string prefabName, Vector3 pos, float strength = 1, float max_strength = 20, float delayTime = 0, float lifeTime = 5)
    {
        CameraShakeEffect se = m_Controller.AddEffect(prefabName) as CameraShakeEffect;

        se.m_Multiplier = Mathf.Clamp(strength * 150 / (pos - camPosition).sqrMagnitude, 0, max_strength);
        se.Invoke("Shake", delayTime);

        DestroyTimer dt = se.GetComponent <DestroyTimer>();

        dt.m_LifeTime = lifeTime;

        return(se);
    }