예제 #1
0
        /// <summary>
        /// A special case for ThreatMonitor+Grudge.Calm due to the source being a struct.
        /// </summary>
        private static PopFX SpawnFXThreat(PopFXManager instance, Sprite icon, string text,
                                           Transform targetTransform, float lifetime, bool track_target)
        {
            PopFX popup = null;

            if (ToastControlPopups.Options.Forgiveness)
            {
                popup = instance.SpawnFX(icon, text, targetTransform, lifetime, track_target);
            }
            return(popup);
        }
예제 #2
0
        /// <summary>
        /// Common transpiled target method for each use of PopFXManager.SpawnFX.
        /// </summary>
        private static PopFX SpawnFXShort(PopFXManager instance, Sprite icon, string text,
                                          Transform targetTransform, float lifetime, bool track_target, object source)
        {
            PopFX popup = null;
            bool  show  = true;

            try {
                // Parameter count cannot be reduced - in order to conform with Klei method
                show = ToastControlPopups.ShowPopup(source, text);
            } catch (Exception e) {
                // Sometimes this gets executed on a background thread and unhandled exceptions
                // cause a CTD
                PUtil.LogException(e);
            }
            if (show)
            {
                popup = instance.SpawnFX(icon, text, targetTransform, lifetime, track_target);
            }
            return(popup);
        }
 protected override void OnPrefabInit()
 {
     base.OnPrefabInit();
     Instance = this;
 }
 public static void DestroyInstance()
 {
     Instance = null;
 }