admin 管理员组

文章数量: 1087649

见缝插针实例

Pin

下面展示一些 内联代码片

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;public class Pin : MonoBehaviour
{public float speed = 20f;private Rigidbody2D rb;private float ready;private bool Isready=true;// Start is called before the first frame updatevoid Start(){rb = GetComponent<Rigidbody2D>();rb.velocity = Vector2.up * speed;}// Update is called once per framevoid Update(){}void OnTriggerEnter2D(Collider2D col){if (col.tag =="Rotator"){rb.velocity = Vector2.zero;if (Random.Range(0f, 1f) > 0.5f){if (col.GetComponent<Rotato>().speed > 0){col.GetComponent<Rotato>().speed = -90;}else{col.GetComponent<Rotato>().speed *= -1;}}else if (col<

本文标签: 见缝插针实例