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


C# Slot.SetChip方法代码示例

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


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

示例1: TeleportChipRoutine

    IEnumerator TeleportChipRoutine(Chip chip, Slot target)
    {
        if (!chip.parentSlot) yield break;

        TrailRenderer trail = chip.gameObject.GetComponentInChildren<TrailRenderer> ();
        float trailTime = 0;

        if (trail) {
            trailTime = trail.time;
            trail.time = 0;
        }

        float defScale = chip.transform.localScale.x;
        float scale = defScale;

        //		chip.animation.Play("Minimizing");
        //
        //		while (chip.animation.isPlaying) {
        //			yield return 0;
        //		}

        while (scale > 0f) {
            scale -= Time.deltaTime * 10f;
            chip.transform.localScale = Vector3.one * scale;
            yield return 0;
        }

        if (!target.GetChip () && chip && chip.parentSlot) {
            Transform a = chip.parentSlot.transform;
            Transform b = target.transform;

            Color color;
            if (chip.id == Mathf.Clamp(chip.id, 0, 5))
                color = Chip.colors[chip.id];
            else
                color = Color.white;

            Lightning l = Lightning.CreateLightning(5, a, b, color);

            target.SetChip(chip);

            chip.transform.position = chip.parentSlot.transform.position;
            yield return 0;
            l.end = null;
        }

        yield return 0;

        if (trail) {
            trail.time = trailTime;
        }

        scale = 0.2f;
        while (scale < defScale) {
            scale += Time.deltaTime * 10f;
            chip.transform.localScale = Vector3.one * scale;
            yield return 0;
        }

        chip.transform.localScale = Vector3.one * defScale;
    }
开发者ID:amisiak7,项目名称:jewels2,代码行数:61,代码来源:AnimationAssistant.cs

示例2: TeleportChipRoutine

    IEnumerator TeleportChipRoutine(Chip chip, Slot target)
    {
        if (!chip.parentSlot) yield break;
        if (chip.destroying) yield break;
        if (target.GetChip() || !target.gravity) yield break;

        Vector3 scale_target = Vector3.zero;
        chip.can_move = false;
        target.SetChip(chip);
        scale_target.z = 1;
        while (chip.transform.localScale.x > 0) {
            chip.transform.localScale = Vector3.MoveTowards(chip.transform.localScale, scale_target, Time.deltaTime * 8);
            yield return 0;
        }

        chip.transform.localPosition = Vector3.zero;
        chip.can_move = true;
        scale_target.x = 1;
        scale_target.y = 1;
        while (chip.transform.localScale.x < 1) {
            chip.transform.localScale = Vector3.MoveTowards(chip.transform.localScale, scale_target, Time.deltaTime * 12);
            yield return 0;
        }

        //Chip new_chip = Instantiate(chip.gameObject).GetComponent<Chip>();
        //new_chip.parentSlot = null;
        //new_chip.transform.position = target.transform.position;
        //target.SetChip(new_chip);

        //chip.HideChip(false);
    }
开发者ID:Bakiet,项目名称:ZombieMatchSurvival,代码行数:31,代码来源:AnimationAssistant.cs


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