static void AttachTopDownScript(GameObject camera, Transform target = null) { // Assign top down script to the camera TopDownCamera cameraScript = null; if (camera) { cameraScript = camera.AddComponent <TopDownCamera>(); // check to see if we have a Target and we have a scrip reference if (cameraScript && target) { cameraScript.target = target; } Selection.activeGameObject = camera; } }
//private void OnEnable() //{ //} public override void OnInspectorGUI() { targetCamera = (TopDownCamera)target; base.OnInspectorGUI(); }