Unity中脚本的基本结构
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
命名空间,灰色表示没有使用
使用的类必须在相应的命名空间,使用类之前必须要启用相应的命名空间。
//继承自MonoBehaviour类 void Start 和Void Update 是方法
public class C#Project : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
}
命名空间控制着类的使用,没有命名空间无法使用类
命名空间 类 方法 变量 对象 运算和调用
