Ejemplo n.º 1
0
        public static GUIContent GetTrackIcon(Type trackAssetType)
        {
            Type tDType = GetCustomDrawer.Invoke(null, new object[] { trackAssetType }) as Type;

            if (tDType == null)
            {
                return(GUIContent.none);
            }
            object tD = Activator.CreateInstance(tDType);

            //There's a null reference exception if we get the default icon, so return none!
            if (tD.GetType() == trackDrawerType)
            {
                return(GUIContent.none);
            }
            return((GUIContent)GetIcon.Invoke(tD, null));
        }
Ejemplo n.º 2
0
        //----------------------------

        /// <summary>
        /// Must be called from OnGUI
        /// </summary>
        public static Color GetTrackColor(Type trackAssetType)
        {
            object[] o = trackAssetType.GetCustomAttributes(typeof(TrackColorAttribute), true);
            if (o.Length > 0)
            {
                return(((TrackColorAttribute)o [0]).color);
            }
            Type tDType = GetCustomDrawer.Invoke(null, new object[] { trackAssetType }) as Type;

            if (tDType == null)
            {
                return(Color.grey);
            }
            object tD = Activator.CreateInstance(tDType);

            return((Color)trackColor.GetValue(tD, null));
        }