protected void OnClick_BtnOK(String goName) { float dragSensitivity; float.TryParse(ipt_dragSensitivity.text, out dragSensitivity); ZooCamera.GetInstance().dragSensitivity = dragSensitivity; //Debug.LogError(dragSensitivity); float crossSensitivity; float.TryParse(ipt_CrossSensitivity.text, out crossSensitivity); ZooCamera.GetInstance().crossSensitivity = crossSensitivity; int dragSmoothDurationMS; int.TryParse(ipt_dragSmoothDurationMS.text, out dragSmoothDurationMS); ZooCamera.GetInstance().dragSmoothDurationMS = dragSmoothDurationMS; //float minOrthographicSize; //float.TryParse(ipt_minPinch.text, out minOrthographicSize); //ZooCamera.GetInstance().minOrthographicSize = minOrthographicSize; //float maxOrthographicSize; //float.TryParse(ipt_maxPinch.text, out maxOrthographicSize); //ZooCamera.GetInstance().maxOrthographicSize = maxOrthographicSize; }
/// <summary> /// 处理养成UI点击交互 /// </summary> /// <param name="gameObject">点击对象</param> void DisposeUIInteractive(GameObject gameObject) { nameID = gameObject.name; //LogWarp.LogError("AAAAAAAAAAAAAAAAAAAAAAAAAA "+nameID); Action action = null; if (clickCallbacks.TryGetValue(gameObject.name, out action)) { sceneUIButtonPos = gameObject.transform; action?.Invoke(); var anim = gameObject.GetComponentInChildren <Animation>(); if (anim != null) { buildingClickSa.Init(anim); buildingClickSa.Play(Config.globalConfig.getInstace().BuildClickAnim); } ZooCamera.GetInstance().PointAtScreenUpCenter(gameObject.transform.position); } //if (gameObject.name == needShowID) //{ // ZooCamera.GetInstance().PointAtScreenUpCenter(gameObject.transform.position); // MessageString.Send((int)GameMessageDefine.UIMessage_OnClickButHidePart, "UIMainPage"); //} }
/// <summary> /// 设置点击场景Ui后的相机偏移 /// </summary> /// <param name="transform"></param> public void SetCameraOnClickScene(Transform transform) { GameObject gameObject = new GameObject(); //gameObject.transform.position = transform.position + new Vector3(-40, -40, 50); TraceCamera.GetInstance().FinishTrace(); ZooCamera.GetInstance().PointAtScreenUpCenter(transform.position); }
/// <summary> /// 隐藏 /// </summary> public override void Hide() { if (GlobalDataManager.GetInstance().playerData.playerZoo.isGuide == false) { ZooCamera.GetInstance().dragMoveTo = ZooCamera.GetInstance().editorInitPos; ZooCamera.GetInstance().cacheTrans.position = ZooCamera.GetInstance().editorInitPos; } base.Hide(); }
void Init() { ipt_dragSensitivity = RegistCompent <InputField>("Editor/ipt_DragSensitivity"); ipt_CrossSensitivity = RegistCompent <InputField>("Editor/ipt_CrossSensitivity"); ipt_dragSmoothDurationMS = RegistCompent <InputField>("Editor/ipt_dragSmoothDurationMS"); ipt_minPinch = RegistCompent <InputField>("Editor/ipt_minPinch"); ipt_maxPinch = RegistCompent <InputField>("Editor/ipt_maxPinch"); txt_Log = RegistCompent <Text>("Editor/txt_Log"); ipt_dragSensitivity.text = ZooCamera.GetInstance().dragSensitivity.ToString(); ipt_CrossSensitivity.text = ZooCamera.GetInstance().crossSensitivity.ToString(); ipt_dragSmoothDurationMS.text = ZooCamera.GetInstance().dragSmoothDurationMS.ToString(); ipt_minPinch.text = ZooCamera.GetInstance().minOrthographicSize.ToString(); ipt_maxPinch.text = ZooCamera.GetInstance().maxOrthographicSize.ToString(); RegistBtnAndClick("Editor/btn_OK", OnClick_BtnOK); RegistBtnAndClick("Editor/btn_Clean", OnClick_BtnClean); RegistBtnAndClick("Editor/btn_Min", OnClick_BtnMin); RegistBtnAndClick("Editor/btn_Max", OnClick_BtnMax); }
protected void OnClick_BtnMin(string goName) { ZooCamera.GetInstance().minOrthographicSize = (ZooCamera.GetInstance() as ZooCamera).GetCamera().orthographicSize; ipt_minPinch.text = ZooCamera.GetInstance().minOrthographicSize.ToString(); }
void OnEnable() { zooCamera = target as ZooCamera; }