protected virtual void Awake() { m_GameObject = gameObject; // if (autoPlay) { alpha = 0.0f; if (delay < 0) { // Do nothing } else if (delay == 0) { FadeIn(); } else { m_DelayedCall = Juggler.Main.DelayCall(() => { FadeIn(); }, delay); } // TODO if (durationKeep > 0.0f) // It will fade out automatically. { onBecameVisible.AddListener(() => { DelayedCall.Free(ref m_DelayedCall); m_DelayedCall = Juggler.Main.DelayCall(() => { FadeOut(); }, durationKeep); }); } } }
public virtual void StartHaptics(int strength, int frequency, float duration = 0.0f) { DelayedCall.Free(ref m_VibrationDC); // strength = Mathf.Clamp(strength, 0, 100); //[0,100],0 -> Default. XDevicePlugin.SendMessage(handle, XDevicePlugin.kMessage_TriggerVibration, (int)((strength <= 0?20:strength) | ((frequency << 16) & 0xFFFF0000)), (int)(duration * 1000) ); if (duration > 0.0f) { m_VibrationDC = Juggler.Main.DelayCall(StopHaptics, duration); } }
public virtual void Stop() { DelayedCall.Free(ref m_DelayedCall); // m_IsPlaying = false; }
protected virtual void OnDestroy() { DelayedCall.Free(ref m_DelayedCall); }
public virtual void StopHaptics() { DelayedCall.Free(ref m_VibrationDC); // XDevicePlugin.SendMessage(handle, XDevicePlugin.kMessage_TriggerVibration, -1, 0); }