//click button Play(UI start) public void buttonPlay() { UIStart.SetActive(false); UIHand.SetActive(true); audioSource.PlayOneShot(audioClips[0], 1f); StartCoroutine(wait(1, 2)); }
public override void OnActivityCreated(Bundle savedInstanceState) { base.OnActivityCreated(savedInstanceState); mContext = (MainActivity)Activity; rdoBtn_singleScan = View.FindViewById <RadioButton> (Resource.Id.rdoBtn_singleScan); rdoBtn_continuous = View.FindViewById <RadioButton> (Resource.Id.rdoBtn_continuous); rdoBtn_continuous.Checked = true; chkAnti = View.FindViewById <CheckBox> (Resource.Id.chkAnti); sqn_Q = View.FindViewById <Spinner> (Resource.Id.sqn_Q); btnScan = View.FindViewById <Button> (Resource.Id.btnScan); LvTags = View.FindViewById <ListView> (Resource.Id.LvTags); btnClear = View.FindViewById <Button> (Resource.Id.btnClear); tvTotal = View.FindViewById <TextView> (Resource.Id.tvTotal); sqn_Q.SetSelection(3); tagList = new List <IDictionary <string, object> > (); adapter = new SimpleAdapter(mContext, tagList, Resource.Layout.listtag_items, new String[] { "tagUii", "tagLen", "tagCount", "tagRssi" }, new int[] { Resource.Id.TvTagUii, Resource.Id.TvTagLen, Resource.Id.TvTagCount, Resource.Id.TvTagRssi }); LvTags.Adapter = adapter; btnScan.Click += delegate { scan(); }; btnClear.Click += delegate { Clear(); }; soundPool = new SoundPool(10, Stream.Music, 0); soundPoolId = soundPool.Load(mContext, Resource.Drawable.beep, 1); handler = new UIHand(this); }
//Check is people or robot public void PeOrRo() { if (word == "Super Handsome" && !closeHand) { UIHand.SetActive(false); UIChoose.SetActive(true); //UIStatus.SetActive(true); //timeMore = Time.time; //StartCoroutine(wait(2, 1f)); //start = true; StartCoroutine(wait(8, 1f)); closeHand = true; word = ""; } if ((word == "Handsome" || word == "Yes") && !closeHand) { exit++; if (exit == 2) { CloseGame(); } audioSource.PlayOneShot(audioClips[7], 1f); word = ""; } }
//获得游戏对象 void GetBallAndTable() { //获得相机 m_cMainCam = Camera.main; GameObject uiroot = GameObject.Find("UI Root"); m_cUICam = NGUITools.FindCameraForLayer(uiroot.layer); //获得母球 WhiteBall = GlobalHelper.g_GlobalLevel.WhiteBall; //获得球桌 Table = GlobalHelper.g_GlobalLevel.Table.transform; if (null == Right) { for (int i = 0; i < Table.childCount; i++) { if ("Right" == Table.GetChild(i).name) { Right = Table.GetChild(i).transform; } } } if (null == Top) { for (int i = 0; i < Table.childCount; i++) { if ("Top" == Table.GetChild(i).name) { Top = Table.GetChild(i).transform; } } } if (null == Down) { for (int i = 0; i < Table.childCount; i++) { if ("Down" == Table.GetChild(i).name) { Down = Table.GetChild(i).transform; } } } if (null == Left) { for (int i = 0; i < Table.childCount; i++) { if ("Left" == Table.GetChild(i).name) { Left = Table.GetChild(i).transform; } } } //获得UI //if(null == HandUI) //{ // for(int i=0;i<gameObject.transform.childCount;i++) // { // if("Hand" == gameObject.transform.GetChild(i).name) // { // HandUI = gameObject.transform.GetChild(i).gameObject; // } // } //} UIMgr = GameObject.Find("UIManager"); UIM = UIMgr.GetComponent <UIManager>(); UIh = UIM.UI <UIHand>(false); if (DP == null) { for (int i = 0; i < UIh.gameObject.transform.childCount; i++) { if (UIh.gameObject.transform.GetChild(i).name == "DontPush") { DP = UIh.gameObject.transform.GetChild(i).gameObject; } } } if (HandUI == null) { for (int i = 0; i < UIh.gameObject.transform.childCount; i++) { if (UIh.gameObject.transform.GetChild(i).name == "Hand") { HandUI = UIh.gameObject.transform.GetChild(i).gameObject; } } } }