Beispiel #1
0
        public void StopBustshotShake(int layer)
        {
            Shaker component = GetLayer(layer).GetComponent <Shaker>();

            if (component != null)
            {
                component.StopShake();
            }
        }
Beispiel #2
0
        public void StopSceneShake()
        {
            Shaker component = SceneCameras.GetComponent <Shaker>();

            if (component != null)
            {
                component.StopShake();
            }
            SceneCameras.transform.localPosition = Vector3.zero;
        }
Beispiel #3
0
        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();
            }
        }