예제 #1
0
        public Tracking_Vessel(TrackingStationWidget widget)
        {
            _vesselWidget = widget;

            _iconSprite = GameObject.Instantiate(Tracking_Loader.IconPrefab);

            _iconSprite.SetType(widget.vessel.vesselType);
        }
예제 #2
0
        private static GameObject GetHeaderObject(VesselType type)
        {
            VesselIconSprite _iconSPrite = GameObject.Instantiate(Tracking_Loader.IconPrefab);

            _iconSPrite.SetType(type);

            return(_iconSPrite.gameObject);
        }
예제 #3
0
        private void processSprites(SpaceTracking tracking)
        {
            var prefab = tracking.listItemPrefab;

            if (prefab == null)
            {
                return;
            }

            prefab.gameObject.AddOrGetComponent <Tracking_WidgetListener>();

            _iconPrefab = prefab.iconSprite;

            Selectable toggle = prefab.toggle.GetComponent <Selectable>();

            if (toggle == null)
            {
                return;
            }

            _normalSprite   = toggle.image.sprite;
            _hoverSprite    = toggle.spriteState.highlightedSprite;
            _activeSprite   = toggle.spriteState.pressedSprite;
            _inactiveSprite = toggle.spriteState.disabledSprite;

            var images = prefab.GetComponentsInChildren <Image>();

            if (images == null || images.Length < 2)
            {
                return;
            }

            _backgroundSprite = images[images.Length - 2].sprite;

            _checkmarkSprite = ((Image)prefab.toggle.graphic).sprite;
        }