本文整理汇总了C#中Card.Reinitialize方法的典型用法代码示例。如果您正苦于以下问题:C# Card.Reinitialize方法的具体用法?C# Card.Reinitialize怎么用?C# Card.Reinitialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Card
的用法示例。
在下文中一共展示了Card.Reinitialize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveCardIntoThisSlotImmediately
public void MoveCardIntoThisSlotImmediately(Card card, int position)
{
GameGuiSlot oldSlot = GameGui.Instance.GetSlotWithCard(card);
if(oldSlot != null)
oldSlot.RemoveCardFromSlot(card);
if(!Cards.Contains(card))
Cards.Add(card);
card.transform.rotation = GetNextCardRotation(card.Side);
card.transform.position = GetCardPosition(position);
card.transform.parent = transform;
if(IsCementarySlot)
card.Reinitialize();
}
示例2: MoveCardIntoThisSlot
public void MoveCardIntoThisSlot(Card card, int position, ST.UnitFunction function, float avarageVelocity, ActionDelegate onFinish)
{
Transform oldParent = card.transform.parent;
card.transform.parent = null;
Vector3 oldPosition = card.transform.position;
Quaternion oldRotation = card.transform.rotation;
card.transform.parent = oldParent;
MoveCardIntoThisSlotImmediately(card, position);
card.transform.parent = null;
Vector3 targetPosition = card.transform.position;
Quaternion targetRotation = card.transform.rotation;
card.transform.position = oldPosition;
card.transform.rotation = oldRotation;
float time = (targetPosition-card.transform.position).magnitude/avarageVelocity;
ST.LinearPositionTransformParam positionTransform = new ST.LinearPositionTransformParam(targetPosition, time, false, function);
TransformManager.Instance.AddTransform(card.gameObject, delegate(int id, GameObject obj, ITransform transform, TransformEventType t)
{
if(t == TransformEventType.OnListFinished)
{
card.transform.parent = gameObject.transform;
if(IsCementarySlot)
card.Reinitialize();
if(onFinish != null)
onFinish();
}
}, positionTransform);
ST.LinearRotationTransformParam rotationTransform = new ST.LinearRotationTransformParam(targetRotation, 0.92f*time, false, function);
TransformManager.Instance.AddTransform(card.gameObject, rotationTransform);
}