本文整理汇总了C#中Box.SetPosition方法的典型用法代码示例。如果您正苦于以下问题:C# Box.SetPosition方法的具体用法?C# Box.SetPosition怎么用?C# Box.SetPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Box
的用法示例。
在下文中一共展示了Box.SetPosition方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}