public void ShowPaiHsImage(Manager_PengGang penggang, FICStartGame startGame, int hs) { this.penggang = penggang; this.hs = hs; this.startGame = startGame; hsImage = transform.Find("image/001").GetComponent <Image>(); hsImage.sprite = startGame.HuaseArray[hs]; }
private void Start() { ficSGame = GetComponent <FICStartGame>(); isDown = false; NetworkIP = Network.player.ipAddress; StartCoroutine(PingConnect()); }
void Start() { var trans = GameObject.Find("ShouPaiContainer").transform.position; maskpai = gameObject.GetComponent <FICMaskPai>(); startGame = transform.Find("/Main Camera").GetComponent <FICStartGame>(); myCards = GetComponent <FICMyCards>(); gangContentTrans = transform.Find("/Game_UI/Interaction_UI/can_buttons_pghg/grid_gang"); buttonGang1 = gangContentTrans.Find("item_button_gang1").gameObject; buttonGang2 = gangContentTrans.Find("item_button_gang2").gameObject; buttonGang3 = gangContentTrans.Find("item_button_gang3").gameObject; }
//引用paipaipai脚本的手牌偏移量,测试 private void Awake() { Start_MJposition = this.transform.position; maskPai = transform.Find("/Main Camera").GetComponent <FICMaskPai>(); paipaipai = transform.Find("/Main Camera").GetComponent <FICpaipaipai>(); managerPengGang = transform.Find("/Main Camera").GetComponent <Manager_PengGang>(); startGame = transform.Find("/Main Camera").GetComponent <FICStartGame>(); myCards = transform.Find("/Main Camera").GetComponent <FICMyCards>(); SPCamera = transform.Find("/3D_SP_Camera").gameObject.GetComponent <Camera>(); ReminderLine = transform.Find("/Game_UI/Interaction_UI/desktop_UI/ReminderLine").gameObject; }
// Use this for initialization void Start() { startGame = transform.Find("/Main Camera").GetComponent <FICStartGame>(); pengGang = transform.Find("/Main Camera").GetComponent <Manager_PengGang>(); managerGame = transform.Find("/Main Camera").GetComponent <Manager_Game>(); pghgGridTrans = transform.Find("/Game_UI/Interaction_UI/can_buttons_pghg/grid_pghg"); guoButtonGO = transform.Find("/Game_UI/Interaction_UI/can_buttons_pghg/grid_pghg/item_button_guo").gameObject; pengButtonGO = transform.Find("/Game_UI/Interaction_UI/can_buttons_pghg/grid_pghg/item_button_peng").gameObject; gangButtonGO = transform.Find("/Game_UI/Interaction_UI/can_buttons_pghg/grid_pghg/item_button_gang").gameObject; huButtonGO = transform.Find("/Game_UI/Interaction_UI/can_buttons_pghg/grid_pghg/item_button_hu").gameObject; tingButtonGO = transform.Find("/Game_UI/Interaction_UI/can_buttons_pghg/grid_pghg/item_button_ting").gameObject; }
void Start() { startGame = GetComponent <FICStartGame>(); playback_Btns = transform.Find("/Game_UI/Fixed_UI/playback_Btns").gameObject; playback_Btns.transform.Find("back").GetComponent <Button>().onClick.AddListener(delegate { SceneManager.LoadScene("Scene_Hall"); RelievePause(); }); playback_Btns.transform.Find("reverse").GetComponent <Button>().onClick.AddListener(delegate { isReverse = true; RelievePause(); }); playback_Btns.transform.Find("pause").GetComponent <Button>().onClick.AddListener(delegate { isPause = !isPause; }); playback_Btns.transform.Find("speed").GetComponent <Button>().onClick.AddListener(delegate { isSpeed = true; RelievePause(); }); playback_Btns.transform.Find("end").GetComponent <Button>().onClick.AddListener(delegate { isEnd = true; RelievePause(); }); pauseSp[0] = Resources.Load <Sprite>("Game_GYMJ/Texture/Game_UI/play"); pauseSp[1] = Resources.Load <Sprite>("Game_GYMJ/Texture/Game_UI/pause"); }
private Manager_Audio managerAudio; ///单例 /// <summary> /// /// </summary> private void Start() { myMaJiangList = new List <MaJiang>(); //=====================对其他脚本的获取============= paipaipai = gameObject.GetComponent <FICpaipaipai>(); maskPai = gameObject.GetComponent <FICMaskPai>(); startGame = gameObject.GetComponent <FICStartGame>(); pengGang = gameObject.GetComponent <Manager_PengGang>(); //=====================为个人手牌,弃牌,碰牌的父物体赋值=============== shouPaiContainerTrans = transform.Find("/Game_Prefabs/TABLE/Game_3DPai/SouthContainer/ShouPaiContainer"); qiPaiContainerTrans = transform.Find("/Game_Prefabs/TABLE/Game_3DPai/SouthContainer/QiPaiContainer"); pengGangPaiContainerTrans = transform.Find("/Game_Prefabs/TABLE/Game_3DPai/SouthContainer/PengGangPaiContainer"); tempShouPaiContainerTrans = shouPaiContainerTrans; //======================手牌预制体============== shouPaiGO = Resources.Load <GameObject>("Game_GYMJ/Prefabs/3Dpai"); tempGO = transform.Find("/Game_Prefabs/emptyGO").gameObject; //======================手牌位置确定============== firstShouPaiTrans = shouPaiContainerTrans.Find("FirstShouPai"); secondShouPaiTrans = shouPaiContainerTrans.Find("SecondShouPai"); thirdShouPaiTrans = shouPaiContainerTrans.Find("ThirdShouPai"); newFirstShouPaiTrans = firstShouPaiTrans.position; moPaiTrans = shouPaiContainerTrans.Find("MoPai"); //======================弃牌位置确定============== firstQiPaiTrans = qiPaiContainerTrans.Find("FirstQiPai"); secondQiPaiTrans = qiPaiContainerTrans.Find("SecondQiPai"); thirdQiPaiTrans = qiPaiContainerTrans.Find("ThirdQiPai"); //======================碰牌位置确定============== firstPengPaiTrans = pengGangPaiContainerTrans.Find("FirstPengPai"); secondPengPaiTrans = pengGangPaiContainerTrans.Find("SecondPengPai"); thirdPengPaiTrans = pengGangPaiContainerTrans.Find("ThirdPengPai"); fourPengPaiTrans = pengGangPaiContainerTrans.Find("FourPengPai"); fivePengPaiTrans = pengGangPaiContainerTrans.Find("FivePengPai"); //======================偏移量确定============== shouPaiOffsetX = secondShouPaiTrans.position - firstShouPaiTrans.position; shouPaiOffsetY = thirdShouPaiTrans.position - firstShouPaiTrans.position; qiPaiOffsetX = secondQiPaiTrans.position - firstQiPaiTrans.position; qiPaiOffsetZ = thirdQiPaiTrans.position - firstQiPaiTrans.position; pengPaiOffsetX = secondPengPaiTrans.position - firstPengPaiTrans.position; pengPaiOffsetZ = thirdPengPaiTrans.position - secondPengPaiTrans.position; pengPaiOffsetLX = fivePengPaiTrans.position - fourPengPaiTrans.position; //======================生成下一张牌的位置确定======= nextPengPaiPos = firstPengPaiTrans.position; nextQiPaiPos = firstQiPaiTrans.position; //======================动态加载3d牌贴图============== textureArray = new Texture[30]; InitTextureFor3D(); managerAudio = GameObject.Find("Main Camera").GetComponent <Manager_Audio>(); ///单例ManagerAudio脚本 }
private void Start() { qipai = transform.Find("/Main Camera").GetComponent <Manager_Qipai>(); startGame = transform.Find("/Main Camera").GetComponent <FICStartGame>(); paipaipai = transform.Find("/Main Camera").GetComponent <FICpaipaipai>(); itemJiS = Resources.Load("Game_GYMJ/Prefabs/item_2dji_s") as GameObject; itemJiN = Resources.Load("Game_GYMJ/Prefabs/item_2dji_n") as GameObject; itemJiW = Resources.Load("Game_GYMJ/Prefabs/item_2dji_w") as GameObject; itemJiE = Resources.Load("Game_GYMJ/Prefabs/item_2dji_e") as GameObject; con_jis = transform.Find("panel_jis/con_jis_s"); con_jin = transform.Find("panel_jis/con_jis_n"); con_jiw = transform.Find("panel_jis/con_jis_w"); con_jie = transform.Find("panel_jis/con_jis_e"); panel_jiGO = transform.Find("panel_jis").gameObject; jis1 = transform.Find("panel_jis/con_jis_s/item_2dji_s1"); jis2 = transform.Find("panel_jis/con_jis_s/item_2dji_s2"); jin1 = transform.Find("panel_jis/con_jis_n/item_2dji_n1"); jin2 = transform.Find("panel_jis/con_jis_n/item_2dji_n2"); jiw1 = transform.Find("panel_jis/con_jis_w/item_2dji_w1"); jiw2 = transform.Find("panel_jis/con_jis_w/item_2dji_w2"); jie1 = transform.Find("panel_jis/con_jis_e/item_2dji_e1"); jie2 = transform.Find("panel_jis/con_jis_e/item_2dji_e2"); sNextPos = jis1.position; nNextPos = jin1.position; wNextPos = jiw1.position; eNextPos = jie1.position; offsetJiS = jis2.position - jis1.position; offsetJiN = jin2.position - jin1.position; offsetJiW = jiw2.position - jiw1.position; offsetJiE = jie2.position - jie1.position; chongJiImage = Resources.Load("Game_GYMJ/Texture/Game_UI/game_icon_CFJ", typeof(Sprite)) as Sprite; chongWuImage = Resources.Load("Game_GYMJ/Texture/Game_UI/game_icon_WGJ", typeof(Sprite)) as Sprite; zeJiImage = Resources.Load("Game_GYMJ/Texture/Game_UI/game_icon_ZRJ", typeof(Sprite)) as Sprite; zeWuImage = Resources.Load("Game_GYMJ/Texture/Game_UI/game_icon_ZRWG", typeof(Sprite)) as Sprite; baoImage = Resources.Load("Game_GYMJ/Texture/Game_UI/game_icon_BAO", typeof(Sprite)) as Sprite; zhuoJiGO = transform.Find("image_zhuoji").gameObject; huangpaiGO = transform.Find("image_huangpai").gameObject; fanji2d = transform.Find("panel_jis/image_fanji2d").GetComponent <Image>(); }
private int count = 1;//第一次点击缺一门的时候,手牌最后一张移动到摸牌区,只用一次 private void Start() { // maskGO = Resources.Load("mask") as GameObject; paipaipai = gameObject.GetComponent <FICpaipaipai>(); startGame = gameObject.GetComponent <FICStartGame>(); myCards = gameObject.GetComponent <FICMyCards>(); Interaction_UIGO = GameObject.Find("Interaction_UI"); QueYiMen = Interaction_UIGO.transform.Find("can_que").gameObject; queWanButton = QueYiMen.transform.Find("btn_que_wan").GetComponent <Button>(); queTiaoButton = QueYiMen.transform.Find("btn_que_tiao").GetComponent <Button>(); queTongButton = QueYiMen.transform.Find("btn_que_tong").GetComponent <Button>(); southImage = transform.Find("/Game_UI/Fixed_UI/Image_que/southImage").GetComponent <Image>(); southImageVec = southImage.gameObject.transform.position; southQuePos = transform.Find("/Game_UI/Fixed_UI/Image_que/southImage1").transform.position; queWanButton.onClick.AddListener(delegate { OnQueWanButtonClick(); }); //queTiaoButton.onClick.AddListener(OnQueTiaoButtonClick); //queTongButton.onClick.AddListener(OnQueTongButtonClick); }
void Start() { startGame = gameObject.GetComponent <FICStartGame>(); countDownText = transform.Find("/Game_UI/Interaction_UI/desktop_UI/countDown").GetComponent <Text>(); //骰子器倒计时 JScountDownText = transform.Find("/Game_UI/PopUp_UI/SQ_jiesan/title/time_60").GetComponent <Text>(); ///解散房间默认同意倒计时 }
/// <summary> /// 初始化 /// </summary> void Start() { //========================================还原语言选择============================================// Mandarin = transform.Find("/Game_UI/PopUp_UI/SheZhi/Language/Mandarin").GetComponent <Toggle>(); Local = transform.Find("/Game_UI/PopUp_UI/SheZhi/Language/Local").GetComponent <Toggle>(); try { Mandarin.isOn = Convert.ToBoolean(PlayerPrefs.GetString("Pop")); Local.isOn = Convert.ToBoolean(PlayerPrefs.GetString("Local")); } catch { } //GameInfo.fangyan = Convert.ToBoolean(PlayerPrefs.GetString("pt")); //GameInfo.fangyan = Convert.ToBoolean(PlayerPrefs.GetString("fangyan")); _ArrayAudioSources = transform.Find("/Audio Source").gameObject.GetComponents <AudioSource>(); if (GameInfo.recon) { gameObject.GetComponent <Reconnection>().clearReturn(); SendRecon(); } managerAudio = GameObject.Find("Main Camera").GetComponent <Manager_Audio>();//单例Manager_Audio脚本 GameUIGO = transform.Find("/Game_UI").gameObject; mjPlaying = gameObject.GetComponent <FICMJPlaying>(); ficjiesan = gameObject.GetComponent <FICjiesan>(); //shezhi.SetActive(false); //进入游戏全屏 Img_setNum = transform.Find("/Game_UI/PopUp_UI/SheZhi").gameObject; SQ_jiesan = transform.Find("/Game_UI/PopUp_UI/SQ_jiesan").gameObject; Room = transform.Find("/Game_UI/Interaction_UI/desktop_UI/Text").GetComponent <Text>(); Room_Id = transform.Find("/Game_UI/Interaction_UI/desktop_UI/Room_Id").GetComponent <Text>(); shareRoomIdButton = Room_Id.transform.Find("btn_shareroom").GetComponent <Button>(); shareRoomIdButton.onClick.AddListener(ShareRoomId); time = transform.Find("/Game_UI/Fixed_UI/Time/Text").GetComponent <Text>(); signal = transform.Find("/Game_UI/Fixed_UI/signal/Text").GetComponent <Text>(); juNum = transform.Find("/Game_UI/Fixed_UI/juNum/Text").GetComponent <Text>(); userTip = transform.Find("/Game_UI/Fixed_UI/userTip_text").GetComponent <Text>(); refresh = transform.Find("/Game_UI/Fixed_UI/But_shuaxin").GetComponent <Button>(); refresh.onClick.AddListener(delegate { ficStartGame.SetRecon(); }); warningPl = GameUIGO.transform.Find("PopUp_UI/warningP").gameObject; warn = GameUIGO.transform.Find("Fixed_UI/warn").gameObject; warningPlInfo = warningPl.transform.Find("info").GetComponent <Text>(); warn.GetComponent <Button>().onClick.AddListener(delegate { ShowSafetyDetection(); }); Head_Mask_E = GameUIGO.transform.Find("Fixed_UI/Heads/Head_east/Head_Mask").GetComponent <Button>(); Head_Mask_W = GameUIGO.transform.Find("Fixed_UI/Heads/Head_west/Head_Mask").GetComponent <Button>(); Head_Mask_S = GameUIGO.transform.Find("Fixed_UI/Heads/Head_south/Head_Mask").GetComponent <Button>(); Head_Mask_N = GameUIGO.transform.Find("Fixed_UI/Heads/Head_north/Head_Mask").GetComponent <Button>(); userInfoPel_E = GameUIGO.transform.Find("PopUp_UI/userInfoPel_E").gameObject; userInfoPel_W = GameUIGO.transform.Find("PopUp_UI/userInfoPel_W").gameObject; userInfoPel_S = GameUIGO.transform.Find("PopUp_UI/userInfoPel_S").gameObject; userInfoPel_N = GameUIGO.transform.Find("PopUp_UI/userInfoPel_N").gameObject; ConnectionStatus_E = GameUIGO.transform.Find("Fixed_UI/Heads/Head_east/ConnectionStatus").gameObject; ConnectionStatus_W = GameUIGO.transform.Find("Fixed_UI/Heads/Head_west/ConnectionStatus").gameObject; ConnectionStatus_S = GameUIGO.transform.Find("Fixed_UI/Heads/Head_south/ConnectionStatus").gameObject; ConnectionStatus_N = GameUIGO.transform.Find("Fixed_UI/Heads/Head_north/ConnectionStatus").gameObject; ray_E = GameUIGO.transform.Find("Fixed_UI/Heads/Head_east/ray").gameObject; ray_W = GameUIGO.transform.Find("Fixed_UI/Heads/Head_west/ray").gameObject; ray_S = GameUIGO.transform.Find("Fixed_UI/Heads/Head_south/ray").gameObject; ray_N = GameUIGO.transform.Find("Fixed_UI/Heads/Head_north/ray").gameObject; integral_E = Head_Mask_E.transform.parent.Find("integral").GetComponent <Text>(); integral_W = Head_Mask_W.transform.parent.Find("integral").GetComponent <Text>(); integral_S = Head_Mask_S.transform.parent.Find("integral").GetComponent <Text>(); integral_N = Head_Mask_N.transform.parent.Find("integral").GetComponent <Text>(); SafetyDetection = transform.Find("/Game_UI/PopUp_UI/SafetyDetection").gameObject; Room_Id.text = GameInfo.room_id.ToString(); if (GameInfo.gameNum >= 2) { Room.gameObject.SetActive(false); Room_Id.gameObject.SetActive(false); } //Room_Id.text +="--"+ Screen.height; //Room_Id.text += "/" + Screen.width; ficStartGame = gameObject.GetComponent <FICStartGame>(); warningPl.transform.Find("yesBtn").GetComponent <Button>().onClick.AddListener(delegate { OnYesButtonClick(); }); warningPl.transform.Find("exitBtn").GetComponent <Button>().onClick.AddListener(delegate { ExitGYMJGame(); }); //usrFD = new Dictionary<int, string>(); allbtnVoice(); }
//private void Awake() //{ // _instance = this; //} private void Start() { _ScriptStartGame = gameObject.GetComponent <FICStartGame>(); //==============牌堆总父物体,以及各个方位牌堆父物体======================== _TransPaiDuiParent = transform.Find("/Game_Prefabs/TABLE/Game_3DPai/PaiDuiContainer"); _TransPaiDuiNorthParent = _TransPaiDuiParent.Find("NorthContainer"); _TransPaiDuiEastParent = _TransPaiDuiParent.Find("EastContainer"); _TransPaiDuiSouthParent = _TransPaiDuiParent.Find("SouthContainer"); _TransPaiDuiWestParent = _TransPaiDuiParent.Find("WestContainer"); //=============对面方位牌堆赋值========================= _TransNorthUp = _TransPaiDuiNorthParent.Find("northup"); _TransNorthDown = _TransPaiDuiNorthParent.Find("northdown"); _TransNorthDownSide = _TransPaiDuiNorthParent.Find("northdown2"); _VecNorthOffset = _TransNorthDownSide.position - _TransNorthDown.position; //==============右边方位牌堆赋值======================== _TransEastUp = _TransPaiDuiEastParent.Find("eastup"); _TransEastDown = _TransPaiDuiEastParent.Find("eastdown"); _TransEastDownSide = _TransPaiDuiEastParent.Find("eastdown2"); _VecEastOffset = _TransEastDownSide.position - _TransEastDown.position; //===============自己方位牌堆赋值======================= _TransSouthUp = _TransPaiDuiSouthParent.Find("southup"); _TransSouthDown = _TransPaiDuiSouthParent.Find("southdown"); _TransSouthDownSide = _TransPaiDuiSouthParent.Find("southdown2"); _VecSouthOffset = _TransSouthDownSide.position - _TransSouthDown.position; //================左边方位牌堆赋值====================== _TransWestUp = _TransPaiDuiWestParent.Find("westup"); _TransWestDown = _TransPaiDuiWestParent.Find("westdown"); _TransWestDownSide = _TransPaiDuiWestParent.Find("westdown2"); _VecWestOffset = _TransWestDownSide.position - _TransWestDown.position; //==============通用:牌堆上下偏移量======================== _VeceUpOffset = _TransWestUp.position - _TransWestDown.position; //==============通用:生成牌的预制体======================== //_GOCube = Resources.Load<GameObject>("Game_GYMJ/Prefabs/emptyGO"); _GOCube = GameObject.Find("emptyGO").gameObject; //==============通用:桌面牌堆盖板======================== _TransDeskCap = transform.Find("/Game_Prefabs/TABLE/盖板"); //==============通用:上下牌数组======================== _ArrayUpPais = new GameObject[54]; _ArrayDownPais = new GameObject[54]; ////==============通用:生成牌堆顺序位置信息======================== //_QuaNorth = Quaternion.Euler(0, 0, 0); //_QuaEast = Quaternion.identity; //_QuaSouth = Quaternion.Euler(0, 90, 90); //_QuaWest = Quaternion.Euler(90, 90, 90); //==============通用:3个方法合成一个,返回结构体======================== message = new ConfirmMessages(); isSkip = true; isSkipGang = true; }