public static void addLeftUserTimer(ClockShakeScript.TimeOutCallBack timeOutCallBack, ClockShakeScript.TimeAlarmCallBack alarmCallBack) { if (null != GameObject.Find(SpriteNameConst.LEFT_USER_TIMER_NAME)) return; Transform prefab = Resources.Load<Transform>("prefab/clockShake/clockShake"); Transform transform = Instantiate(prefab, new Vector3(-5.5f, 4f, 0.01f), Quaternion.identity) as Transform; transform.gameObject.name = SpriteNameConst.LEFT_USER_TIMER_NAME; ClockShakeScript clockShakeScript = transform.GetComponent<ClockShakeScript>(); clockShakeScript.setTimeOutCallBack(timeOutCallBack); clockShakeScript.setTimeAlarmCallBack(alarmCallBack); }
public void timerAlarmCallBack(ClockShakeScript clockShakeScript) { SoundHelper.playClockAlarmSound(); }