本文整理汇总了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;
}
示例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);
}