private bool ObjectValidForUpdate(ICanvasElement element) { bool flag = element != null; if (element is UnityEngine.Object) flag = element as UnityEngine.Object != (UnityEngine.Object) null; return flag; }
private bool ObjectValidForUpdate(ICanvasElement element) { var valid = element != null; var isUnityObject = element is Object; if (isUnityObject) valid = (element as Object) != null; //Here we make use of the overloaded UnityEngine.Object == null, that checks if the native object is alive. return valid; }
private void InternalRegisterCanvasElementForGraphicRebuild(ICanvasElement element) { if (this.m_PerformingGraphicUpdate) { Debug.LogError(string.Format("Trying to add {0} for graphic rebuild while we are already inside a graphic rebuild loop. This is not supported.", element)); } else { this.m_GraphicRebuildQueue.Add(element); } }
private void InternalUnRegisterCanvasElementForLayoutRebuild(ICanvasElement element) { if (this.m_PerformingLayoutUpdate) { Debug.LogError(string.Format("Trying to remove {0} from rebuild list while we are already inside a rebuild loop. This is not supported.", element)); } else { instance.m_LayoutRebuildQueue.Remove(element); } }
public static bool TryRegisterCanvasElementForGraphicRebuild(ICanvasElement element) { return instance.InternalRegisterCanvasElementForGraphicRebuild(element); }
public static void UnRegisterCanvasElementForRebuild(ICanvasElement element) { instance.InternalUnRegisterCanvasElementForLayoutRebuild(element); instance.InternalUnRegisterCanvasElementForGraphicRebuild(element); }
/// <summary> /// Remove the given element from both the graphic and the layout rebuild lists. /// </summary> /// <param name="element"></param> public static void UnRegisterCanvasElementForRebuild(ICanvasElement element) { instance.InternalUnRegisterCanvasElementForLayoutRebuild(element); instance.InternalUnRegisterCanvasElementForGraphicRebuild(element); }
private bool InternalRegisterCanvasElementForLayoutRebuild(ICanvasElement element) { if (m_LayoutRebuildQueue.Contains(element)) return false; if (m_PerformingLayoutUpdate) { Debug.LogError(string.Format("Trying to add {0} for layout rebuild while we are already inside a layout rebuild loop. This is not supported.", element)); return false; } return m_LayoutRebuildQueue.AddUnique(element); }
/// <summary> /// /// <para> /// Rebuild the layout of the given element. /// </para> /// /// </summary> /// <param name="element">Element to rebuild.</param> public static void RegisterCanvasElementForLayoutRebuild(ICanvasElement element) { CanvasUpdateRegistry.instance.InternalRegisterCanvasElementForLayoutRebuild(element); }
public static IDisposable BindScaleTo(this ICanvasElement input, IReactiveProperty <Vector3> property, BindingTypes bindingType = BindingTypes.Default, params IFilter <Vector3>[] filters) { return(input.transform.BindScaleTo(property, bindingType, filters).AddTo(input as MonoBehaviour)); }
private bool InternalRegisterCanvasElementForGraphicRebuild(ICanvasElement element) { int id = (element as Object).GetInstanceID(); if (this.m_GraphicQueueLookup.ContainsKey(id)) return false; m_GraphicQueueLookup[id] = id; this.m_GraphicRebuildQueue.Add(element); return true; }
private bool InternalRegisterCanvasElementForLayoutRebuild(ICanvasElement element) { if (this.m_LayoutRebuildQueue.Contains(element)) return false; return this.m_LayoutRebuildQueue.AddUnique(element); }
private void InternalUnRegisterCanvasElementForLayoutRebuild(ICanvasElement element) { int id = (element as Object).GetInstanceID(); //element.LayoutComplete(); TMP_UpdateRegistry.instance.m_LayoutRebuildQueue.Remove(element); m_GraphicQueueLookup.Remove(id); }
/// <summary> /// Function to unregister elements which no longer require a rebuild. /// </summary> /// <param name="element"></param> public static void UnRegisterCanvasElementForRebuild(ICanvasElement element) { TMP_UpdateRegistry.instance.InternalUnRegisterCanvasElementForLayoutRebuild(element); TMP_UpdateRegistry.instance.InternalUnRegisterCanvasElementForGraphicRebuild(element); }
private bool ObjectValidForUpdate(ICanvasElement element) { var valid = element != null; var isUnityObject = element is Object; if (isUnityObject) valid = (element as Object) != null; return valid; }
private void InternalRegisterCanvasElementForLayoutRebuild(ICanvasElement element) { if (m_LayoutRebuildQueue.Contains(element)) return; m_LayoutRebuildQueue.Add(element); }
public static IDisposable BindScaleTo(this ICanvasElement input, Func <Vector3> getter, Action <Vector3> setter, BindingTypes bindingType = BindingTypes.Default, params IFilter <Vector3>[] filters) { return(input.transform.BindScaleTo(getter, setter, bindingType, filters).AddTo(input as MonoBehaviour)); }
/// <summary> /// Disable the given element from both the graphic and the layout rebuild lists. /// </summary> /// <param name="element"></param> public static void DisableCanvasElementForRebuild(ICanvasElement element) { instance.InternalDisableCanvasElementForLayoutRebuild(element); instance.InternalDisableCanvasElementForGraphicRebuild(element); }
private static int SortLayoutList(ICanvasElement x, ICanvasElement y) { return(CanvasUpdateRegistry.ParentCount(x.transform) - CanvasUpdateRegistry.ParentCount(y.transform)); }
/// <summary> /// Method to handle objects that need updating. /// </summary> private void PerformUpdateForCanvasRendererObjects() { //Debug.Log("Performing update of CanvasRenderer objects at Frame: " + Time.frameCount); // Processing elements that require a layout rebuild. //this.m_PerformingLayoutUpdate = true; for (int index = 0; index < m_LayoutRebuildQueue.Count; index++) { ICanvasElement element = TMP_UpdateRegistry.instance.m_LayoutRebuildQueue[index]; element.Rebuild(CanvasUpdate.Prelayout); } //this.m_PerformingLayoutUpdate = false; if (m_LayoutRebuildQueue.Count > 0) { m_LayoutRebuildQueue.Clear(); m_LayoutQueueLookup.Clear(); } // Processing elements that require a graphic rebuild. //this.m_PerformingGraphicUpdate = true; for (int index = 0; index < m_GraphicRebuildQueue.Count; index++) { ICanvasElement element = TMP_UpdateRegistry.instance.m_GraphicRebuildQueue[index]; element.Rebuild(CanvasUpdate.PreRender); } //this.m_PerformingGraphicUpdate = false; // If there are no objects in the queue, we don't need to clear the lists again. if (m_GraphicRebuildQueue.Count > 0) { m_GraphicRebuildQueue.Clear(); m_GraphicQueueLookup.Clear(); } }
/// <summary> /// Function to register elements which require a layout rebuild. /// </summary> /// <param name="element"></param> public static void RegisterCanvasElementForLayoutRebuild(ICanvasElement element) { TMP_UpdateRegistry.instance.InternalRegisterCanvasElementForLayoutRebuild(element); }
private static int SortLayoutList(ICanvasElement x, ICanvasElement y) { return CanvasUpdateRegistry.ParentCount(x.transform) - CanvasUpdateRegistry.ParentCount(y.transform); }
/// <summary> /// Try and add the given element to the rebuild list. /// Will not return if successfully added. /// </summary> /// <param name="element">The element that is needing rebuilt.</param> public static void RegisterCanvasElementForGraphicRebuild(ICanvasElement element) { instance.InternalRegisterCanvasElementForGraphicRebuild(element); }
/// <summary> /// /// <para> /// Was the element scheduled. /// </para> /// /// </summary> /// <param name="element">Element to rebuild.</param> /// <returns> /// /// <para> /// Was the element scheduled. /// </para> /// /// </returns> public static bool TryRegisterCanvasElementForLayoutRebuild(ICanvasElement element) { return CanvasUpdateRegistry.instance.InternalRegisterCanvasElementForLayoutRebuild(element); }
/// <summary> /// <para>Was the element scheduled.</para> /// </summary> /// <param name="element">Element to rebuild.</param> /// <returns> /// <para>Was the element scheduled.</para> /// </returns> public static bool TryRegisterCanvasElementForLayoutRebuild(ICanvasElement element) { return(CanvasUpdateRegistry.instance.InternalRegisterCanvasElementForLayoutRebuild(element)); }
/// <summary> /// Creates an instance that will restore the control's position to the specified location. /// </summary> public RestoreLocation(ICanvasElement control, MathCore.Vector location) : this(control, new Point(location.X, location.Y)) { }
private void InternalRegisterCanvasElementForLayoutRebuild(ICanvasElement element) { m_LayoutRebuildQueue.Add(element); }
public IAndroidCanvasElement Create(ICanvasElement element) { var image = (ImageElement)element; return(new AndroidImageElement(image)); }
/// <summary> /// Try and add the given element to the rebuild list. /// </summary> /// <param name="element">The element that is needing rebuilt.</param> /// <returns> /// True if the element was successfully added to the rebuilt list. /// False if either already inside a Graphic Update loop OR has already been added to the list. /// </returns> public static bool TryRegisterCanvasElementForGraphicRebuild(ICanvasElement element) { return(instance.InternalRegisterCanvasElementForGraphicRebuild(element)); }
public TimeSpanBinding(ICanvasElement graphic) : base(graphic) { }
private static int SortLayoutList(ICanvasElement x, ICanvasElement y) { Transform t1 = x.transform; Transform t2 = y.transform; return ParentCount(t1) - ParentCount(t2); }
public Binding(ICanvasElement graphic) { _graphic = graphic; }
public static void RegisterCanvasElementForGraphicRebuild(ICanvasElement element) { instance.InternalRegisterCanvasElementForGraphicRebuild(element); }
public TextBinding(ICanvasElement graphic, string formatting = "{0}") : base(graphic) { _formatting = formatting; }
private bool InternalRegisterCanvasElementForGraphicRebuild(ICanvasElement element) { if (m_PerformingGraphicUpdate) { Debug.LogError(string.Format("Trying to add {0} for graphic rebuild while we are already inside a graphic rebuild loop. This is not supported.", element)); return false; } return m_GraphicRebuildQueue.AddUnique(element); }
public SliderBinding(ICanvasElement graphic) : base(graphic) { }
private void InternalUnRegisterCanvasElementForGraphicRebuild(ICanvasElement element) { if (m_PerformingGraphicUpdate) { Debug.LogError(string.Format("Trying to remove {0} from rebuild list while we are already inside a rebuild loop. This is not supported.", element)); return; } element.GraphicUpdateComplete(); instance.m_GraphicRebuildQueue.Remove(element); }
private void InternalRegisterCanvasElementForLayoutRebuild(ICanvasElement element) { this.m_LayoutRebuildQueue.Add(element); }
public void OnElementSelected(object sender, ICanvasElement element) { SelectedElement = element; }
private bool InternalRegisterCanvasElementForLayoutRebuild(ICanvasElement element) { return(!this.m_LayoutRebuildQueue.Contains(element) && this.m_LayoutRebuildQueue.AddUnique(element)); }