Exemple #1
0
        /**
         * <summary>Sets the layer of the Hotspot according to whether or not it is within the proximity of a Hotspot detector.</summary>
         * <param name = "detectHotspot">The DetectHotspots component to check the proximity against</param>
         */
        public void UpdateProximity(DetectHotspots detectHotspots)
        {
            if (detectHotspots == null)
            {
                return;
            }

            tooFarAway = !detectHotspots.IsHotspotInTrigger(this);
            if (tooFarAway)
            {
                PlaceOnDistantLayer();
            }
            else
            {
                PlaceOnHotspotLayer();
            }
        }
Exemple #2
0
        public void UpdateProximity(DetectHotspots detectHotspots)
        {
            if (detectHotspots == null)
            {
                return;
            }

            tooFarAway = !detectHotspots.IsHotspotInTrigger(this);
            if (tooFarAway)
            {
                if (gameObject.layer == LayerMask.NameToLayer(KickStarter.settingsManager.hotspotLayer))
                {
                    gameObject.layer = LayerMask.NameToLayer(KickStarter.settingsManager.distantHotspotLayer);
                }
            }
            else
            {
                if (gameObject.layer == LayerMask.NameToLayer(KickStarter.settingsManager.distantHotspotLayer))
                {
                    gameObject.layer = LayerMask.NameToLayer(KickStarter.settingsManager.hotspotLayer);
                }
            }
        }