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


C# Card.Reinitialize方法代码示例

本文整理汇总了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();
    }
开发者ID:rno81,项目名称:java-test,代码行数:16,代码来源:GameGuiSlot.cs

示例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);
    }
开发者ID:rno81,项目名称:java-test,代码行数:34,代码来源:GameGuiSlot.cs


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