本周学习了“见缝插针”的制作方法
先要有圆和针,这是最基本的,然后要使圆转起来
圆的转速代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.Rotate(0,0,-1);
}
}
然后要获取UI,生成实例化针,并且使鼠标左键生效,生成分数文本
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;//获取UI
public class slhz : MonoBehaviour {
public GameObject PinPrefab;//针的预设物
private Transform insPoint;//实例化的位置
public qier currentPin;//当前针
public bool isOver;
public GameObject zzz;
public Text zzzlllText;//分数显示的文本
public int zzzlll = 0 ;//分数
// Use this for initialization
void Start () {
insPoint = GameObject.Find("InsPoint").transform;
InsPin();
}
// Up