示例#1
0
    private void FadeInOutline()
    {
        // Setup the color to use for the flash
        Color       color = effectColor;
        ButtonSound sound = ButtonSound.Hover;

        // If we have an operation source then instead set the color to the intended operation type color
        if (OperationInProgress)
        {
            color = UISettings.GetOperatorColor(operationSource.MatrixParent.IntendedNextOperationType);
            sound = ButtonSound.Preview;
        }

        // Create the pop effect for hovering
        PunchSize(sound);

        // If wer still have an outline then make it invisible
        if (currentOutline)
        {
            currentOutline.Remove();
        }

        // Fade in a new outline
        currentOutline = OutlineManager.FadeInOutline(transform, effectType, color);
    }
示例#2
0
    public void ShowPreview(MatrixOperation operation)
    {
        // Set the text for the main text to the preview
        SetFraction(mainText, PreviewFraction);

        // Use the small text to display what the fraction was before
        if (CurrentFraction != PreviewFraction)
        {
            SetFraction(smallText, CurrentFraction);
            previewArrow.gameObject.SetActive(true);

            // Set the color of the arrow to the intended operation color
            foreach (Graphic graphic in arrowGraphics)
            {
                graphic.color = UISettings.GetOperatorColor(operation.type);
            }
        }

        // If this is along the diagonal and the preview is the identity then create the preview effect
        if (columnIndex == rowParent.RowIndex && MatrixParent.PreviewMatrix.isIdentity)
        {
            currentPreviewEffect.FadeIn();
        }
    }