using DG.Tweening; using System; using UnityEngine; using UnityEngine.UI; using XRTool.Util; namespace XRTool.WorldUI { public class XRIcon3D : XRImage3D { private Renderer icon; [HideInInspector] public Texture2D img; protected override void Start() { base.Start(); SetIcon(); } public Renderer Icon { get { if (!icon) { icon = UnityUtil.GetBreadthChild(transform, "Icon"); } return icon; } } public void SetIcon() { if (Icon && img && Icon.enabled) { try { UnityUtil.ChangeMateTexture2D(Icon, img); } catch (Exception ex) { UnityLog.LogError(icon.material + " have no mainTexture"); } } } } }