学习记录

来源:互联网 发布:淘宝猫胡子是假货吗 编辑:程序博客网 时间:2024/06/08 03:20

Resources.Load();必须放在Resources目录下才有效

GameObject root = new GameObject (rootName);

//生成Prefab 添加一张预览用的Sprite
GameObject go = new GameObject(goName);

go.transform.SetParent (root.transform);


EditorCurveBinding pos_x_curveBinding = new EditorCurveBinding();
pos_x_curveBinding.type = typeof(Transform);
pos_x_curveBinding.path = "";
pos_x_curveBinding.propertyName = "m_LocalPosition.x";

PrefabUtility.CreatePrefab(directoryName + "/" + rootName + ".prefab", root);
DestroyImmediate(root);

场景切换

using UnityEngine.SceneManagement;

buttonStart.onClick.AddListener (returnMainScene);

private void returnMainScene(){
Debug.Log ("切换到主场景");
SceneManager.LoadScene (1);
}

摄像机类型   projection

透视(perspective)远大近小

正交(orthographic)  实际比例,没有透视变形