CameraView InstanceCameraPrefab() { string prefabName = "Player/Player"; GameObject prefab = Resources.Load <GameObject>(prefabName); GameObject go = GameObject.Instantiate(prefab); CameraView instance = go.GetComponent <CameraView>(); if (instance == null) { Debug.LogError("null player obj" + prefabName); } return(instance); }
//------------------------------------------------ public CameraPlayer(Transform playerroot = null) { Debug.Log("CameraPlayer start"); m_CameraView = playerroot.GetComponent <CameraView>(); Debug.Log("m_CameraView ok"); m_CameraView.m_Player = this; m_ClickMark = playerroot.GetComponentInChildren <KeyboardMark>(); for (int i = 0; i < playerroot.childCount; ++i) { if (playerroot.GetChild(i).name == "StartPress") { m_PressMark = playerroot.GetChild(i).gameObject; break; } } }