static void AttachTopDownScript(GameObject aCamera, Transform aTarget) { //Assign Top Down Script to the camera MOBA_TopDown_Camera cameraScript = null; if (aCamera) { cameraScript = aCamera.AddComponent <MOBA_TopDown_Camera>(); //Check to see if we have a Target and we have a Script reference if (cameraScript && aTarget) { cameraScript.m_Target = aTarget; } Selection.activeObject = aCamera; } }
private void OnEnable() { targetCamera = (MOBA_TopDown_Camera)target; }