예제 #1
0
        private T CreateComponent <T>(GameObject prefab, Transform parent, ITooltipComponent value)
            where T : TooltipComponentView
        {
            var component = Instantiate(prefab, parent).GetComponent <T>();

            component.Refresh(value);
            return(component);
        }
 public override void Refresh(ITooltipComponent value)
 {
     try {
         Refresh((T)value);
     }
     catch (InvalidCastException) {
         throw new ArgumentException($"{value.GetType()} cannot be converted to {typeof(T)}");
     }
 }
예제 #3
0
        public PropertyView GenerateTooltipProperty(Transform parent, ITooltipComponent value)
        {
            var view = CreateComponent <PropertyView>(propertyPrefab, parent, value);

            if (currentTooltip.Font)
            {
                view.SetFont(currentTooltip.Font);
            }

            return(view);
        }