修改调整
This commit is contained in:
30
Assets/Plugins/FairyGUI/Examples/Model/ModelMain.cs
Normal file
30
Assets/Plugins/FairyGUI/Examples/Model/ModelMain.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
|
||||
public class ModelMain : MonoBehaviour
|
||||
{
|
||||
GComponent _mainView;
|
||||
|
||||
void Start()
|
||||
{
|
||||
Application.targetFrameRate = 60;
|
||||
Stage.inst.onKeyDown.Add(OnKeyDown);
|
||||
|
||||
_mainView = this.GetComponent<UIPanel>().ui;
|
||||
|
||||
Object prefab = Resources.Load("Role/npc");
|
||||
GameObject go = (GameObject)Object.Instantiate(prefab);
|
||||
go.transform.localPosition = new Vector3(61, -89, 1000); //set z to far from UICamera is important!
|
||||
go.transform.localScale = new Vector3(180, 180, 180);
|
||||
go.transform.localEulerAngles = new Vector3(0, 100, 0);
|
||||
_mainView.GetChild("holder").asGraph.SetNativeObject(new GoWrapper(go));
|
||||
}
|
||||
|
||||
void OnKeyDown(EventContext context)
|
||||
{
|
||||
if (context.inputEvent.keyCode == KeyCode.Escape)
|
||||
{
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Assets/Plugins/FairyGUI/Examples/Model/ModelMain.cs.meta
Normal file
12
Assets/Plugins/FairyGUI/Examples/Model/ModelMain.cs.meta
Normal file
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eabf5f06c048be84cbc8226659385e1f
|
||||
timeCreated: 1456390000
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user