Exemple #1
0
        protected override void EnablePreview()
        {
            base.EnablePreview();
            matFocusIndex = GridManager.I.GetInactiveFocusIndex();
            GridManager.I.ActivateFocus(matFocusIndex);
            float focusRadius = size.magnitude / 2f * SettingsManager.I.roomSettings.gridSnapStep;

            GridManager.I.SetFocusRadius(matFocusIndex, focusRadius, focusRadius * .75f);
            previewOutlined.EnableHighlight();
        }
Exemple #2
0
        public void Update()
        {
            if (!started || finished)
            {
                return;
            }

            if (startTime == 0f)
            {
                startTime = Time.time;
            }

            hintStartTime = startTime + startDelay;
            float time = Time.time - hintStartTime;

            if (time < 0)
            {
                return;
            }
            else if (hintDuration > 0 && time > hintDuration)
            {
                Finish();
                return;
            }

            float loopedTime = time % blinkDuration;
            float offTime    = blinkDuration * offPortion;

            if (loopedTime < offTime / 2f || loopedTime > blinkDuration - offTime / 2f)               // Off
            {
                if (prevOn)
                {
                    outlined.DisableHighlight(-1);
                }
                prevOn = false;
            }
            else                 // On
            {
                float onProgress       = (loopedTime - offTime / 2f) / (blinkDuration - offTime);
                float blinkStrength    = (onProgress > .5f) ? 1 - onProgress * 2f + 1 : onProgress * 2f;
                Color actualBlinkColor = blinkColor;
                actualBlinkColor.a = blinkStrength;

                if (!prevOn)
                {
                    outlined.EnableHighlight(-1, actualBlinkColor);
                }
                outlined.UpdateHighlight(-1, actualBlinkColor);

                prevOn = true;
            }
        }
Exemple #3
0
 public void EnablePreview()
 {
     outlined.EnableHighlight();
 }