见缝插针实例
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<
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
