public void StopBustshotShake(int layer) { Shaker component = GetLayer(layer).GetComponent <Shaker>(); if (component != null) { component.StopShake(); } }
public void StopSceneShake() { Shaker component = SceneCameras.GetComponent <Shaker>(); if (component != null) { component.StopShake(); } SceneCameras.transform.localPosition = Vector3.zero; }
public static void ShakeObject(GameObject target, float speed, int level, int attenuation, int vector, int loopcount, bool isblocking) { Shaker component = target.GetComponent <Shaker>(); if (component != null) { component.StopShake(); } GameSystem.Instance.RegisterAction(delegate { Shaker shaker = target.AddComponent <Shaker>(); shaker.StartShake(speed, level, attenuation, vector, loopcount, isblocking); }); if (isblocking) { GameSystem.Instance.ExecuteActions(); } }