您的位置:首页 > 移动开发 > Unity3D

unity3的第三天01

2016-07-13 13:53 555 查看
材质颜色设定
#pragma strict

function Start () {
GetComponent.<Renderer>().material.color = Color.black;
}

function Update () {

}

鼠标点击事件

using UnityEngine;
using System.Collections;
using UnityEditor;
public class test3 : MonoBehaviour {

public Transform prefab;
void OnMouseDown()
{
for (int i = 0; i < 10; i++) {
Instantiate (prefab, new Vector3 ((i * 2.0F) + (-2.5F), 4.62F, -12.81F), Quaternion.identity);
}
}
// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}
}

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: