public void Shake(Vector3 shakeAmount, byte shakeType = 1, System.Action callback = null, int numberOfShakes = 0) { if (SkillEventMgr.ActiveEvent && (SkillEventShaker == null || SkillEventShaker.gameObject == null || !SkillEventShaker.gameObject.activeSelf)) { return; } if (!SkillEventMgr.ActiveEvent && (Shaker == null || Shaker.gameObject == null || !Shaker.gameObject.activeSelf)) { return; } CameraShakeData data; if (shakeDataDic.TryGetValue(shakeType, out data)) { if (SkillEventMgr.ActiveEvent && SkillEventShaker.gameObject.activeSelf) { SkillEventShaker.Shake(data.shakeType, numberOfShakes != 0 ? numberOfShakes : data.numberOfShakes, shakeAmount, data.rotationAmount, data.distance, data.speed, data.decay, 0, data.multiplyByTimeScale); } else if (Camera.main != null && Camera.main.gameObject.activeSelf) { Shaker.Shake(data.shakeType, numberOfShakes != 0 ? numberOfShakes : data.numberOfShakes, shakeAmount, data.rotationAmount, data.distance, data.speed, data.decay, 0, data.multiplyByTimeScale); } } else { ShakeDefault(); } }
public void ShakeDefault() { //Debug.Log( "ShakeDefault()", transform ); if (SkillEventMgr.ActiveEvent) { SkillEventShaker.Shake(); } else { Shaker.Shake(); } }
public void ShakeClose() { if (SkillEventShaker == null) { return; } if (SkillEventMgr.ActiveEvent) { SkillEventShaker.CancelShake(); } else { Shaker.CancelShake(); } }