コード例 #1
0
    void CreateSwatches(float delay)
    {
        for (int s = 0; s < 10; s++)
        {
            PlayerColor color     = PlayerColor.allColors[s];
            SwatchBox   swatchBox = new SwatchBox(color);

            if (swatchBox.player.color == slot.player.color)
            {
                swatchBox.isSelected = true;
            }

            swatchBoxes.Add(swatchBox);
            keyboardAndSwatchContainer.AddChild(swatchBox);

            swatchBox.SignalPress += HandleSwatchTap;
            swatchBox.scale        = 0.0f;

            Go.to(swatchBox, 0.3f, new TweenConfig()
                  .floatProp("scale", 1.0f)
                  .setDelay(delay + 0.04f * (float)s)
                  .setEaseType(EaseType.ExpoOut));
        }

        RepositionSwatches();
    }
コード例 #2
0
ファイル: PlayerEditor.cs プロジェクト: MattRix/ScorekeeperX
    void CreateSwatches(float delay)
    {
        for(int s = 0; s<10; s++)
        {
            PlayerColor color = PlayerColor.allColors[s];
            SwatchBox swatchBox = new SwatchBox(color);

            if(swatchBox.player.color == slot.player.color)
            {
                swatchBox.isSelected = true;
            }

            swatchBoxes.Add(swatchBox);
            keyboardAndSwatchContainer.AddChild(swatchBox);

            swatchBox.SignalPress += HandleSwatchTap;
            swatchBox.scale = 0.0f;

            Go.to(swatchBox, 0.3f, new TweenConfig()
                  .floatProp("scale",1.0f)
                  .setDelay(delay + 0.04f*(float)s)
                  .setEaseType(EaseType.ExpoOut));
        }

        RepositionSwatches();
    }