当前位置: 首页>>代码示例>>C#>>正文


C# Box.DoTapEffect方法代码示例

本文整理汇总了C#中Box.DoTapEffect方法的典型用法代码示例。如果您正苦于以下问题:C# Box.DoTapEffect方法的具体用法?C# Box.DoTapEffect怎么用?C# Box.DoTapEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Box的用法示例。


在下文中一共展示了Box.DoTapEffect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Setup

    public void Setup(Slot slot)
    {
        this.slot = slot;
        this.nameBox = slot.nameBox;

        nameBox.isTouchable = false;

        Vector2 pos = OtherToLocal(nameBox,new Vector2(0,0));

        AddChild(nameBox);
        nameBox.SetPosition(pos);

        Cell nameCell = CellManager.GetCellFromGrid(3,6,2,2);

        nameBox.anchorCell = nameCell;

        Go.to(nameBox, 0.7f, new TweenConfig()
              .floatProp("x",nameCell.x)
              .floatProp("y",nameCell.y)
              .floatProp("width",nameCell.width)
              .floatProp("height",nameCell.height)
              .setEaseType(EaseType.ExpoInOut)
              //.onComplete(() => {})
        );

        ////////SETUP DELETE

        Cell deleteCell = CellManager.GetCellFromGrid(1,2,2,2);

        AddChild(deleteBox = new Box());
        deleteBox.Init(slot.player,deleteCell.width,deleteCell.height);
        deleteBox.y = deleteCell.y;
        deleteBox.x = -Config.WIDTH/2 - deleteCell.width - 30.0f; //put if offscreen to the left
        deleteBox.isTouchable = false; //don't allow it to be touched until it builds in
        deleteBox.anchorCell = deleteCell;

        deleteBox.contentContainer.AddChild(deleteSkull = new FSprite("Icons/Skull"));
        deleteSkull.color = Color.black;

        Go.to(deleteBox, 0.4f, new TweenConfig()
              .floatProp("x",deleteCell.x)
              .setEaseType(EaseType.ExpoOut)
              .setDelay(0.3f)
              .onComplete(()=>{deleteBox.isTouchable = true;})
              );

        deleteBox.SignalPress += box =>
        {
            FSoundManager.PlaySound("UI/Button1");
            deleteBox.DoTapEffect();
            StartDelete();
        };

        ////////SETUP OK
        ///
        Cell okCell = CellManager.GetCellFromGrid(7,8,2,2);

        AddChild(okBox = new SpriteBox(slot.player,"Icons/Checkmark",okCell.width,okCell.height));
        okBox.y = okCell.y;
        okBox.x = Config.WIDTH/2 + okCell.width + 30.0f; //put if offscreen to the right
        okBox.isTouchable = false; //don't allow it to be touched until it builds in
        okBox.anchorCell = okCell;

        okBox.isEnabled = (slot.player.name.Length > 0);

        Go.to(okBox, 0.4f, new TweenConfig()
              .floatProp("x",okCell.x)
              .setEaseType(EaseType.ExpoOut)
              .setDelay(0.3f)
              .onComplete(()=>{okBox.isTouchable = true;})
              );

        okBox.SignalPress += box =>
        {
            FSoundManager.PlaySound("UI/Button1");
            slot.player.color.PlayNormalSound();
            okBox.DoTapEffect();
            Close();
        };

        nameBox.isEditMode = true;

        CreateKeyboard(0.0f);
        CreateSwatches(0.3f);
    }
开发者ID:MattRix,项目名称:ScorekeeperX,代码行数:85,代码来源:PlayerEditor.cs

示例2: ResetGroup

    public ResetGroup(float width)
    {
        this.width = width;

        AddChild(plusBox = new MathBox(MathType.Plus));
        AddChild(minusBox = new MathBox(MathType.Minus));

        AddChild(zeroBox = new ZeroBox());

        AddChild(cancelBox = new SpriteBox(Player.NullPlayer,"Icons/Cancel",100,100));
        AddChild(okBox = new SpriteBox(Player.NullPlayer,"Icons/Checkmark",100,100));

        plusBox.hasFastRepeatZones = true;
        minusBox.hasFastRepeatZones = true;

        if(PlayerPrefs.HasKey(PREFS_KEY))
        {
            zeroBox.resetAmount = PlayerPrefs.GetInt(PREFS_KEY);
        }

        float boxSize = Config.SLOT_HEIGHT;
        float padding = Config.PADDING_S;

        plusBox.SetSize(boxSize,boxSize);
        minusBox.SetSize(boxSize,boxSize);
        zeroBox.SetSize(width-boxSize*2-padding*2,boxSize);

        plusBox.SetPosition(zeroBox.width/2 + padding + plusBox.width/2, padding/2 + plusBox.height/2);
        minusBox.SetPosition(-zeroBox.width/2 - padding - minusBox.width/2, padding/2 + minusBox.height/2);
        zeroBox.SetPosition(0,padding/2 + zeroBox.height/2);

        cancelBox.SetSize((width-padding)/2,boxSize);
        okBox.SetSize((width-padding)/2,boxSize);

        cancelBox.SetPosition(-padding/2 - cancelBox.width/2, -padding/2 - cancelBox.height/2);
        okBox.SetPosition(padding/2 + okBox.width/2, -padding/2 - okBox.height/2);

        minusBox.SignalTick += (b,ticks) =>
        {
            zeroBox.resetAmount -= ticks;
            UpdateResetAmount();
        };

        plusBox.SignalTick += (b,ticks) =>
        {
            zeroBox.resetAmount += ticks;
            UpdateResetAmount();
        };

        zeroBox.SignalRelease += (b) =>
        {
            zeroBox.DoTapEffect();
            FSoundManager.PlaySound("UI/ResetToZero");
            zeroBox.resetAmount = 0;
            UpdateResetAmount();
        };

        cancelBox.SignalRelease += (b) =>
        {
            Keeper.instance.slotList.ApplyResetScores(false);
            cancelBox.isTouchable = false;
            cancelBox.DoTapEffect();
            Keeper.instance.EndResetMode();
            FSoundManager.PlaySound("UI/Cancel");
        };

        okBox.SignalRelease += (b) =>
        {
            Keeper.instance.slotList.ApplyResetScores(true);
            okBox.isTouchable = false;
            okBox.DoTapEffect();
            Keeper.instance.EndResetMode();
            FSoundManager.PlaySound("UI/ResetOk");

            SKDataManager.MarkDirty();
        };

        UpdateResetAmount();

        instance = this;
    }
开发者ID:MattRix,项目名称:ScorekeeperX,代码行数:81,代码来源:ResetGroup.cs

示例3: HandleSwatchTap

    void HandleSwatchTap(Box box)
    {
        box.DoTapEffect();

        box.player.color.PlayNormalSound();
        if(noteCount % 4 == 0) box.player.color.PlayBassSound();
        noteCount++;

        for(int s = 0; s<swatchBoxes.Count; s++)
        {
            swatchBoxes[s].isSelected = (swatchBoxes[s] == box);
        }

        slot.player.color = box.player.color;
    }
开发者ID:MattRix,项目名称:ScorekeeperX,代码行数:15,代码来源:PlayerEditor.cs


注:本文中的Box.DoTapEffect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。