/// <summary> /// 附加分享脚本 /// </summary> /// <param name="user"></param> public static void Attch(GameObject user) { if (_instance == null) { _instance = user.AddComponent <ShareTool>(); } }
private void Update() { if (Input.GetKeyDown(KeyCode.A)) { //设置相机垂直方向上FOv mTargetCamera.fieldOfView = 2 * Mathf.Atan(mCanvasSize.y * 0.5f / mDistance) * Mathf.Rad2Deg; } if (Input.GetKeyDown(KeyCode.C)) { StartCoroutine(ShareTool.GetCameraTextureForShare(mTargetCamera, (int)mCanvasSize.x, (int)mCanvasSize.y, null)); } }
private void Awake() { Instance = this; }