//当按钮按下触发事件 /// <summary> /// 按钮 按下事件 /// </summary> /// <param name="eventData"> 传递 GameObject</param> private void PointerDowkEvent(GameObject eventData) { GameObject tmpPress = GetButtonComponent(NAME_PRESS); Debug.Log("dddddddddd"); if (tmpPress != null) { buttonState = ButtonSort.State_press; tmpPress.SetActive(true); GetButtonComponent(NAME_DEFAULT).SetActive(false); if (IsDownEvent) { ////播放特效 //GameObject tmpEffect = GetButtonComponent(NAME_EFFECT); //if (tmpEffect != null) //{ // //关闭特效 // isUishow(tmpEffect, false); // //发送消息 // MsgBase.SendMsg(m_ButtonMsg); // return; //} if (gameObject.tag == "HomePage") { MsgBase.SendMsg <string>(m_ButtonMsg, gameObject.name); } MsgBase.SendMsg(m_ButtonMsg); return; } } }
public void SetHttpData(bool isLaod, Dictionary <string, JsonData> _tmpDictionary, bool isCode) { if (isEnable) { return; } if (itemManager == null) { SendDebug(" itemManager kong"); return; } if (isCode == false) { bool isRemoveItem = itemManager.RemoveItemDictinary2(); IsLoadingData = false; StopCoroutine(LoadingData(100)); m_callback(0, false); isLoadData = false; MsgBase.SendMsg <string, bool>("SetButtonLose", "UPphoto", false); MsgBase.SendMsg <bool>("isRefresh", false); SetIsAngle02(delegate() { MsgBase.SendMsg <bool, float>("ShowBlur", true, 10); }, false); // uiRoot.ShowAlert(null, "这里未发现故事", "留下我的故事", delegate() { UpPhoto(); }, "到世界逛逛", delegate() { MsgBase.SendMsg<Callback<bool, string>>("U2N_U_OpenWorld", null); }, true); return; } if (isLaod == false) { // LoadFailure(); return; } itemManager.SetData(_tmpDictionary); }
void OnEnable() { isEnable = false; MsgBase.ShowUI(); if (itemManager != null) { itemManager.MsgGps(true); foreach (var item in itemManager.GetItemObjectDict()) { item.Value.AnimatorPlay2(); } } if (PhotoCameraObj != null) { PhotoCameraObj.SetActive(true); } if (photoprompt != null) { StartCoroutine(photoprompt.SetPrompt()); } IsHeip = false; IsClickPhtoto = false; MsgBase.SendMsg <string, bool>("SetButtonLose", "UPphoto", false); MsgBase.SendMsg <bool>("isRefresh", false); if (movableUI) { //HomePageMag.Initacne.HomePageChildDictionary["movableUI"].SetActive(true); } }
private void help01Evnet() { sUImenuhelp.MenuDictionary["Backround"].gameObject.SetActive(false); isHelp = false; MsgBase.SendMsg <string>("HideScene", "PhotoScene"); MsgBase.SendMsg <string>("OnOpenScene", "Tutorial"); }
private void OffGyroallback() { // 创建弓箭 UI ArrowManager.transform.SetParent(SCameraManager.currentCamera.gameObject.transform.parent.gameObject.transform); MsgBase.SendMsg("OpenGyroController"); movableManager.GetGps2(SkySceneManager.Instance.currentE, SkySceneManager.Instance.currentN); }
public void TimeUpData() { MsgBase.SendMsg("BaseButtonEvnet2"); speed = 0; StartLoading(0); isLoadData = true; }
private void Load(float _longitude, float _latitude) { if (isLoad == false) { m_currentN = _latitude; m_currentE = _longitude; LoadHttp(_latitude, _longitude); m_TimeOnUpdateTow = 10; return; } if (Vector2.Distance(new Vector2(m_currentN, m_currentE), new Vector2(_latitude, _longitude)) > 0.00100F) { m_currentN = _latitude; m_currentE = _longitude; LoadHttp(_latitude, _longitude); m_TimeOnUpdateTow = 10; return; } if (Vector2.Distance(new Vector2(m_currentN, m_currentE), new Vector2(_latitude, _longitude)) > 0.00050F) { m_currentN = _latitude; m_currentE = _longitude; LoadHttp(_latitude, _longitude); m_TimeOnUpdateTow = 10; return; } MsgBase.SendMsg <string, bool>("SetButtonLose", "UPphoto", false); MsgBase.SendMsg <bool>("isRefresh", false); }
private void OffGyroallback() { PlayerPrefs.SetInt("GUIDE3D", 3); MsgBase.MsgAdd <GameObject, MySkyInputEvent.DragState, Vector2, Vector2, Vector3>("EventDrag", EventDrag); MsgBase.MsgAdd <GameObject, MySkyInputEvent.ClickState, Vector2>("EventClick", OnClickPhoto); PhotoCameraObj = new GameObject(); PhotoCameraObj.name = "PhotoCameraObj1111111"; PhotoCameraObj.transform.SetParent(SCameraManager.currentCamera.gameObject.transform.parent.gameObject.transform); Royboj = Instantiate(Resources.Load("photo/Rotation")) as GameObject; Royboj.SetActive(false); Royboj.transform.SetParent(PhotoCameraObj.transform); Royboj.transform.localPosition = new Vector3(0, -2.5f, 6.22f); tutorialProcess2 = new TutorialProcess2(TutorialUIObj, TutorialUIObj2); FindConfig = MonoBehaviour.Instantiate(Resources.Load("photo/Find_config")) as GameObject; FindConfig.name = "FindConfig"; FindConfig.transform.SetParent(gameObject.transform); m_FindConfig = FindConfig.GetComponent <Find_Item_Config>(); m_PhotoConfigArray = new PhotoConfigArray(); TutorialItem tutorialItem = new TutorialItem(gameObject); tutorialItem.Init(20); MsgBase.SendMsg("OpenGyroController"); }
void Start() { // PlayerPrefs.DeleteAll(); if (PlayerPrefs.GetInt("GUIDE3DGL") == 0) { jiaochengs[0].gameObject.SetActive(true); } else { MsgBase.SendMsg("OnOpenScene", "PhotoScene"); ui.SetActive(true); } EventTriggerListener.Get(jiaochengs[0].gameObject).onClick = onjiaochengClick_00; EventTriggerListener.Get(jiaochengs[1].gameObject).onClick = onjiaochengClick_01; EventTriggerListener.Get(jiaochengs[2].gameObject).onClick = onjiaochengClick_02; EventTriggerListener.Get(jiaochengs[3].gameObject).onClick = onjiaochengClick_03; EventTriggerListener.Get(jiaochengs[5].gameObject).onClick = onjiaochengClick_04; EventTriggerListener.Get(Backbutton.gameObject).onClick = onBackbuttonClick; EventTriggerListener.Get(Upbutton.gameObject).onClick = onUpbuttonClick; EventTriggerListener.Get(Minubutton.gameObject).onClick = onMinubuttonClick; EventTriggerListener.Get(MinuButtons[0].gameObject).onClick = onClick_00; EventTriggerListener.Get(MinuButtons[1].gameObject).onClick = onClick_01; EventTriggerListener.Get(MinuButtons[2].gameObject).onClick = onClick_02; EventTriggerListener.Get(MinuButtons[3].gameObject).onClick = onClick_03; EventTriggerListener.Get(MinuButtons[4].gameObject).onClick = onClick_04; }
private void OffGyroallback() { IsHeip = false; PhotoCameraObj = new GameObject(); PhotoCameraObj.name = "PhotoCameraObj"; PhotoCameraObj.transform.SetParent(SCameraManager.currentCamera.gameObject.transform.parent.gameObject.transform); PhotoCameraObj.transform.localPosition = Vector3.zero; SCameraManager.currentCamera.gameObject.transform.localPosition = Vector3.zero; Royboj = Instantiate(Resources.Load("photo/Rotation")) as GameObject; Royboj.SetActive(false); Royboj.transform.SetParent(PhotoCameraObj.transform); Royboj.transform.localPosition = new Vector3(0, -2.5f, 6.22f); MsgBase.SendMsg("OpenGyroController"); InitUI(); Init(); MsgBase.ShowUI(); try { itemManager.MsgGps(false); } catch (System.Exception e) { Debug.Log("" + e); } PhotoCameraObj.transform.localPosition = Vector3.zero; }
/// <summary> /// 点击事件 /// </summary> private void Click() { //播放特效 GameObject tmpEffect = GetButtonComponent(NAME_EFFECT); if (tmpEffect != null) { //关闭特效 isUishow(tmpEffect, false); //发送消息 if (gameObject.tag == "HomePage") { MsgBase.SendMsg <string>(m_ButtonMsg, gameObject.name); return; } MsgBase.SendMsg(m_ButtonMsg); return; } if (gameObject.tag == "HomePage") { MsgBase.SendMsg <string>(m_ButtonMsg, gameObject.name); return; } MsgBase.SendMsg(m_ButtonMsg); return; }
public void StartLoading(float t) { IsLoadingData = true; SetIsAngle02(delegate() { MsgBase.SendMsg <bool, float>("ShowBlur", false, 10); }, true); MsgBase.SendMsg <bool>("isRefresh", true); MsgBase.SendMsg <string, bool>("SetButtonLose", "UPphoto", true); StartCoroutine(LoadingData(t)); }
protected override void OnClose(Callback callback) { tutorialProcess2 = null; m_PhotoConfigArray = null; Destroy(PhotoCameraObj); MsgBase.MsgRemove <GameObject, MySkyInputEvent.DragState, Vector2, Vector2, Vector3>("EventDrag", EventDrag); MsgBase.MsgRemove <GameObject, MySkyInputEvent.ClickState, Vector2>("EventClick", OnClickPhoto); MsgBase.SendMsg <string>("OnOpenScene", "PhotoScene"); }
private void LoadFailure() { IsLoadingData = false; m_callback(0, false); // uiRoot.ShowAlert(null, "加载失败,请重试", "重试", delegate() { Updatephoto(); }, null, null, true); SetIsAngle02(delegate() { MsgBase.SendMsg <bool, float>("ShowBlur", true, 10); }, false); isLoadData = false; MsgBase.SendMsg <string, bool>("SetButtonLose", "UPphoto", false); MsgBase.SendMsg <bool>("isRefresh", false); }
public void onUIBackdButtonUp(GameObject go) { Debug.Log("onUIBackdButtonUp"); LoadBackButton.gameObject.SetActive(false); MovableScene.Instance.Load(100); //HomePageMag.Initacne.HomePageChildDictionary["movableUI"].SetActive(true); HomePageMag.Initacne.SetHomeButtonEvnetEnumEnd(); MsgBase.SendMsg <string>("OnOpenScene", "PhotoScene"); MsgBase.SendMsg <string>("RemoveScene", "MovableScene"); }
private void onjiaochengClick_04(GameObject go) { jiaochengs[4].gameObject.SetActive(false); MsgBase.SendMsg("OnOpenScene", "PhotoScene"); ui.SetActive(true); if (isToggle) { PlayerPrefs.SetInt("GUIDE3DGL", 2); } }
public void PhotoNotReachable() { IsLoadingData = false; StopCoroutine(LoadingData(100)); m_callback(0, false); MsgBase.SendMsg <string, bool>("SetButtonLose", "UPphoto", false); MsgBase.SendMsg <bool>("isRefresh", false); photoprompt.Off(); m_PhotoNotReachable.Show(); }
private void UItishi4Event(GameObject go) { SetUItishi4Color(0f, 0, 0.5f); PhotoScene.Instance.jiaocheng = 0; PhotoScene.Instance.IsClickPhtoto = false; UItishi3.transform.SetSiblingIndex(2); UItishi4.transform.SetSiblingIndex(2); PlayerPrefs.SetInt("3DStart", 3); MsgBase.SendMsg <bool>("ISslide", false); UItishi4.SetActive(false); }
//我的页面返回 private void U2N_N_CloseMainMenu() { M_HomeButtonEvnetEnum = HomeButtonEvnetEnum.END; PhotoScene.Instance.isNotReachable(true); if (PhotoScene.Instance.movableUI) { // HomePageChildDictionary["movableUI"].SetActive(true); } MsgBase.SendMsg <Callback, bool>("SetIsAngle02", null, false); MsgBase.ShowUI(); }
private void waitShowReminder() { IsLoadingData = false; StopCoroutine(LoadingData(100)); m_callback(100, true); isLoadData = false; MsgBase.SendMsg <string, bool>("SetButtonLose", "UPphoto", false); MsgBase.SendMsg <bool>("isRefresh", false); //SUIManager.instance.reminder.ShowReminder("没有发现新故事", 3); SetIsAngle02(delegate() { MsgBase.SendMsg <bool, float>("ShowBlur", true, 10); }, false); }
protected override void OnOpen(Callback <float, bool> callback) { Instance = this; m_callback = callback; Load(0); TimeEnd = 30; isTimeEnd = true; StartCoroutine(LoadTimeEnd()); movableManager = new MovableManager(gameObject); MsgBase.SendMsg <Callback>("OffGyroControllerCallback", OffGyroallback); MsgBase.SendMsg <bool, float>("ShowBlur", true, 10); }
private void UpEnd() { Debug.Log(" 发送 拍照请求 U2N_U_OpenSendStory "); MsgBase.SendMsg <Callback <bool, string> >("U2N_U_OpenSendStory", delegate(bool a, string s) { if (a) { //错误 specialEffectsUI.clickHide(MsgBase.ShowUI); } }); }
private void OnClickPhoto(GameObject obj, MySkyInputEvent.ClickState ClickState, Vector2 pos) { if (obj == null) { MsgBase.SendMsg("BaseButtonEvnet2"); } if (IsHeip || IsClickPhtoto) { return; } itemManager.ItemClick(obj, pos, specialEffectsUI, ClickState); }
private void onfenxiangButton(GameObject go) { string shareurl = PlayerPrefs.GetString("shareurl"); string shareimagepath = PlayerPrefs.GetString("shareimagepath"); string title = "快来参加AR夺宝,好东西免费抢了!"; string view_title = "这么多宝贝免费抢!\n赶快告诉小伙伴们来抢宝贝了~"; string content = "我用AR夺宝抢到了好多好东西,你也快来跟我一起抢吧!"; string weibo_content = "我用AR夺宝抢到了好多好东西,你也快来跟我一起抢吧!请点击" + " " + shareurl; My_debugNet.SendDebugLog("onfenxiangButton----" + shareurl + shareimagepath); MsgBase.SendMsg <string, string, string, string, string, string, Callback <bool, string> > ("U2N_U_OpenShare", shareurl, title, view_title, content, weibo_content, shareimagepath, null); My_debugNet.SendDebugLog("onfenxiangButton--122--" + shareurl + shareimagepath); }
void Update() { if (movableManager == null) { return; } if (ArrowManager.activeSelf) { AnimatorStateInfo AnstateInfo = Crossbow.GetComponent <Animator>().GetCurrentAnimatorStateInfo(0); if (AnstateInfo.IsName("Crossbow")) { Debug.Log("AnstateInfo.normalizedTime======" + AnstateInfo.normalizedTime); if (AnstateInfo.normalizedTime >= 0.2f && isCrossbowAnim == false) { // Crossbow.GetComponent<Animator>().speed = 0; Crossbow.GetComponent <Animator>().Play("CrossbowLoading"); isCrossbowAnim = true; } } if (AnstateInfo.IsName("CrossbowLoading")) { if (AnstateInfo.normalizedTime >= 1.6f) { isCrossbowAnim = false; Crossbow.GetComponent <Animator>().Play("State"); MsgBase.SendMsg("LoadLoadArrow"); } } } Ray ray = Camera.main.ScreenPointToRay(objd.GetComponent <RectTransform>().position); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { BalloonV3 = Camera.main.ScreenToWorldPoint(objd.GetComponent <RectTransform>().position); Debug.DrawLine(objd2.transform.position, hit.collider.transform.position); } else { BalloonV3 = Vector3.zero; } if (Input.GetKeyDown(KeyCode.A)) { movableManager.arrow.fire(BalloonV3); BalloonV3 = Vector3.zero; } }
public void UpPhoto(bool isUP, JsonData jd) { if (isUP == false) { PhotoScene.Instance.specialEffectsUI.clickHide(UPHide2); return; } PhotoScene.Instance.IsUpPhoto = true; if (GetItmeDataObjectCount() < 20) { UpPoints = GetItmeDataObjectCount(); } tmpUpItemData = new ItemData(jd, PhotoRoot); tmpUpItemData.isUp = true; Vector3 tmpV3 = m_PhotoConfigArray.GetPos(UpPoints); ItemData tmpFindItemData = FindItemData(tmpV3); if (tmpFindItemData != null) { bool isRemove = RemoveItemDictinary(tmpFindItemData.nid); if (isRemove) { tmpUpItemData.SetPos(tmpV3); m_itemGameObjectDictinary.Add(jd["cardId"].ToString(), tmpUpItemData); tmpUpItemData.itemRootObj.transform.SetParent(PhotoRoot.transform); tmpUpItemData.item.gameObject.SetActive(true); PhotoScene.Instance.specialEffectsUI.clickHide(UPHide); } else { PhotoScene.SendDebug("上传出错 已有相片 未能删除"); } } else { tmpUpItemData.SetPos(tmpV3); m_itemGameObjectDictinary.Add(jd["cardId"].ToString(), tmpUpItemData); tmpUpItemData.itemRootObj.transform.SetParent(PhotoRoot.transform); tmpUpItemData.item.gameObject.SetActive(true); MsgBase.SendMsg <bool, float>("ShowBlur", true, 10); PhotoScene.Instance.specialEffectsUI.clickHide(UPHide); } }
void Update() { if (Input.GetKeyDown(KeyCode.B)) { JsonData jd4 = new JsonData(); jd4["Event"] = "EventClickItme"; Native.Instance.NativeToUnity(jd4.ToJson()); } if (Input.GetKeyDown(KeyCode.T)) { // bool isRemoveItem = itemManager.RemoveItemDictinary2(); System.DateTime T = new System.DateTime(); n1 = n1 + 10; Messenger.Broadcast <bool, string, System.DateTime, float, float, float, float, float>("U2N_N_GPS", true, "eeeeeeeeee", T, n1, 39.90639f, 123, 123, 123); } if (IsUpPhoto) { MsgBase.SendMsg <bool, float>("ShowBlur", true, 10); } if (itemManager != null && isClose == false) { itemManager.RootRotation(); } IsAngle = IsUserAngle(); if (photoprompt != null && IsAngle02 == false) { if (IsAngle && jiaocheng == 1 && IsClickPhtoto == false) { IsClickPhtoto = true; MsgBase.SendMsg <bool>("ISslide", true); photoprompt.ShowUItishi3(true); photoprompt.Off(); return; } if (jiaocheng == 0 && isLoadData == false && IsUpPhoto == false) { photoprompt.Show(IsAngle); } } // My_debugNet.SendDebugLog("IsUpPhoto---" + IsUpPhoto + "---isLoadData---" + isLoadData + "---jiaocheng---" + jiaocheng + "---IsAngle---" + IsAngle); }
public void Show(bool isUI) { Color rgbImage = UItishi.transform.FindChild("Image").GetComponent <Image>().color; Color rgbText = UItishi.transform.FindChild("Text").GetComponent <Text>().color; if (!isUI) { UItishi.SetActive(true); MsgBase.SendMsg <bool, float>("ShowBlur", false, 10); UItishi.gameObject.GetComponent <Animator>().enabled = true; UItishi.transform.FindChild("Image").GetComponent <Image>().DOColor(new Color(rgbImage.r, rgbImage.g, rgbImage.b, 1f), 0.5f); //UItishi.transform.FindChild("Text").GetComponent<Text>().DOColor(new Color(rgbText.r, rgbText.g, rgbText.b, 1f), 0.5f); } else { MsgBase.SendMsg <bool, float>("ShowBlur", true, 10); UItishi.gameObject.GetComponent <Animator>().enabled = false; UItishi.transform.FindChild("Image").GetComponent <Image>().DOColor(new Color(rgbImage.r, rgbImage.g, rgbImage.b, 0f), 0.5f); //UItishi.transform.FindChild("Text").GetComponent<Text>().DOColor(new Color(rgbText.r, rgbText.g, rgbText.b, 0f), 0.5f); } }
private IEnumerator PhotographFile() { yield return(new WaitForFixedUpdate()); yield return(new WaitForSeconds(0.5f)); SCameraManager.currentCamera.PhotographFile( delegate(bool isok, string filename) { if (isok) { //消息通知 安卓 发送地址 MsgBase.SendMsg <string, Callback <bool, string> >("U2N_U_Cheese", filename, null); } else { //出错提示 MsgBase.ShowUI(); IsPhotograph = false; } }); }
public void LoadingEnd() { if (UpDateItme) { int k = itemManager.CreateitemSnu; if (k == 0) { Invoke("waitShowReminder", 1); return; } else { // SUIManager.instance.reminder.ShowReminder("发现" + k + "个新故事", 3); } itemManager.CreateitemSnu = 0; } else { if (itemManager.GetItmeDataObjectCount() == 0) { } // SUIManager.instance.reminder.ShowReminder("周围发现" + itemManager.GetItmeDataObjectCount() + "个故事", 3); itemManager.CreateitemSnu = 0; UpDateItme = true; StartCoroutine(photoprompt.SetPrompt()); } IsLoadingData = false; if (PlayerPrefs.GetInt("3DStart") == 2) { // Invoke("Startjiaocheng", 3f); } SetIsAngle02(delegate() { MsgBase.SendMsg <bool, float>("ShowBlur", true, 10); }, false); StopCoroutine(LoadingData(100)); m_callback(100, true); isLoadData = false; MsgBase.SendMsg <string, bool>("SetButtonLose", "UPphoto", false); MsgBase.SendMsg <bool>("isRefresh", false); }