コード例 #1
0
        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;
            }
        }
コード例 #2
0
 private void OnEnable()
 {
     targetCamera = (MOBA_TopDown_Camera)target;
 }