标签:int void invoke led use system ant ack 旋转
using UnityEngine;
using System.Collections;
public class FoodSnake : MonoBehaviour {
public int yLimit = 30;
public int xLimit = 22;
public GameObject SSFood;
// Use this for initialization
void Start ()
{
InvokeRepeating("Food", 1, 4);
}
// Update is called once per frame
void Food()
{
int x = Random.Range(-xLimit,xLimit);
int y = Random.Range(-yLimit,yLimit);
//Quaternion.identity=旋转的角度0.0.0.0 SSFood是这个cube new Vector2(x, y) 物体出现的位置
Instantiate(SSFood, new Vector2(x, y), Quaternion.identity);
}
void Update ()
{
}
}
标签:int void invoke led use system ant ack 旋转
原文地址:http://www.cnblogs.com/ylllove/p/6106433.html