コード例 #1
0
        public static TrackDrawer CreateInstance(TrackAsset trackAsset)
        {
            if (trackAsset == null)
            {
                return(Activator.CreateInstance <TrackDrawer>());
            }

            TrackDrawer drawer;

            try
            {
                drawer = (TrackDrawer)Activator.CreateInstance(TimelineHelpers.GetCustomDrawer(trackAsset.GetType()));
            }
            catch (Exception)
            {
                drawer = Activator.CreateInstance <TrackDrawer>();
            }

            drawer.track = trackAsset;
            return(drawer);
        }
コード例 #2
0
        public static TrackDrawer CreateInstance(TrackAsset trackAsset)
        {
            TrackDrawer result;

            if (trackAsset == null)
            {
                result = Activator.CreateInstance <TrackDrawer>();
            }
            else
            {
                TrackDrawer trackDrawer = null;
                try
                {
                    trackDrawer = (TrackDrawer)Activator.CreateInstance(TimelineHelpers.GetCustomDrawer(trackAsset.GetType()));
                }
                catch (Exception)
                {
                    trackDrawer = Activator.CreateInstance <TrackDrawer>();
                }
                result = trackDrawer;
            }
            return(result);
        }