// Use this for initialization void Start() { shakePlugin = ShakePlugin.GetInstance(); shakePlugin.SetDebug(0); shakePlugin.Init(); SetSensitivitySlider(); SetDelayUpdateSlider(); shakePlugin.SetCallbackListener(OnShake); shakePlugin.RegisterSensorListener(); }
public static ShakePlugin GetInstance() { if(instance==null){ container = new GameObject(); container.name="ShakePlugin"; instance = container.AddComponent( typeof(ShakePlugin) ) as ShakePlugin; DontDestroyOnLoad(instance.gameObject); aupHolder = AUPHolder.GetInstance(); instance.gameObject.transform.SetParent(aupHolder.gameObject.transform); } return instance; }
public static ShakePlugin GetInstance() { if (instance == null) { container = new GameObject(); container.name = "ShakePlugin"; instance = container.AddComponent(typeof(ShakePlugin)) as ShakePlugin; DontDestroyOnLoad(instance.gameObject); aupHolder = AUPHolder.GetInstance(); instance.gameObject.transform.SetParent(aupHolder.gameObject.transform); } return(instance); }