Inheritance: MonoBehaviour
Beispiel #1
0
	void OnDoubleClick ()
	{
		if (current != null || !isColliderEnabled) return;
		current = this;
		EventDelegate.Execute(onDoubleClick);
		current = null;
	}
	void OnDragOut (GameObject go)
	{
		if (current != null) return;
		current = this;
		EventDelegate.Execute(onDragOut);
		current = null;
	}
Beispiel #3
0
	void OnPress (bool pressed)
	{
		current = this;
		if (pressed) EventDelegate.Execute(onPress);
		else EventDelegate.Execute(onRelease);
		current = null;
	}
Beispiel #4
0
	void OnSelect (bool selected)
	{
		current = this;
		if (selected) EventDelegate.Execute(onSelect);
		else EventDelegate.Execute(onDeselect);
		current = null;
	}
Beispiel #5
0
	void OnHover (bool isOver)
	{
		current = this;
		if (isOver) EventDelegate.Execute(onHoverOver);
		else EventDelegate.Execute(onHoverOut);
		current = null;
	}
Beispiel #6
0
	void OnDragEnd ()
	{
		if (current != null) return;
		current = this;
		EventDelegate.Execute(onDragEnd);
		current = null;
	}
	void OnDoubleClick ()
	{
		if (current != null) return;
		current = this;
		EventDelegate.Execute(onDoubleClick);
		current = null;
	}
Beispiel #8
0
	void OnPress (bool pressed)
	{
		if (current != null || !isColliderEnabled) return;
		current = this;
		if (pressed) EventDelegate.Execute(onPress);
		else EventDelegate.Execute(onRelease);
		current = null;
	}
Beispiel #9
0
	void OnHover (bool isOver)
	{
		if (current != null || !isColliderEnabled) return;
		current = this;
		if (isOver) EventDelegate.Execute(onHoverOver);
		else EventDelegate.Execute(onHoverOut);
		current = null;
	}
Beispiel #10
0
	void OnSelect (bool selected)
	{
		if (current != null || !isColliderEnabled) return;
		current = this;
		if (selected) EventDelegate.Execute(onSelect);
		else EventDelegate.Execute(onDeselect);
		current = null;
	}
Beispiel #11
0
 private void OnDragEnd()
 {
     if (UIEventTrigger.current != null)
     {
         return;
     }
     UIEventTrigger.current = this;
     EventDelegate.Execute(this.onDragEnd);
     UIEventTrigger.current = null;
 }
Beispiel #12
0
 private void OnDrag(Vector2 delta)
 {
     if (UIEventTrigger.current != null)
     {
         return;
     }
     UIEventTrigger.current = this;
     EventDelegate.Execute(this.onDrag);
     UIEventTrigger.current = null;
 }
Beispiel #13
0
 private void OnDoubleClick()
 {
     if (UIEventTrigger.current != null)
     {
         return;
     }
     UIEventTrigger.current = this;
     EventDelegate.Execute(this.onDoubleClick);
     UIEventTrigger.current = null;
 }
Beispiel #14
0
 private void OnDragOut(GameObject go)
 {
     if (UIEventTrigger.current != null)
     {
         return;
     }
     UIEventTrigger.current = this;
     EventDelegate.Execute(this.onDragOut);
     UIEventTrigger.current = null;
 }
	void OnEnable ()
	{
		mTrigger = target as UIEventTrigger;
		EditorPrefs.SetBool("ET0", EventDelegate.IsValid(mTrigger.onHoverOver));
		EditorPrefs.SetBool("ET1", EventDelegate.IsValid(mTrigger.onHoverOut));
		EditorPrefs.SetBool("ET2", EventDelegate.IsValid(mTrigger.onPress));
		EditorPrefs.SetBool("ET3", EventDelegate.IsValid(mTrigger.onRelease));
		EditorPrefs.SetBool("ET4", EventDelegate.IsValid(mTrigger.onSelect));
		EditorPrefs.SetBool("ET5", EventDelegate.IsValid(mTrigger.onDeselect));
		EditorPrefs.SetBool("ET6", EventDelegate.IsValid(mTrigger.onClick));
		EditorPrefs.SetBool("ET7", EventDelegate.IsValid(mTrigger.onDoubleClick));
	}
	void OnEnable ()
	{
		mTrigger = target as UIEventTrigger;
		EditorPrefs.SetFloat("ET11", mTrigger.movementThreshold);
		EditorPrefs.SetBool("ET0", EventDelegate.IsValid(mTrigger.onHoverOver));
		EditorPrefs.SetBool("ET1", EventDelegate.IsValid(mTrigger.onHoverOut));
		EditorPrefs.SetBool("ET2", EventDelegate.IsValid(mTrigger.onPress));
		EditorPrefs.SetBool("ET3", EventDelegate.IsValid(mTrigger.onRelease));
		EditorPrefs.SetBool("ET4", EventDelegate.IsValid(mTrigger.onSelect));
		EditorPrefs.SetBool("ET5", EventDelegate.IsValid(mTrigger.onDeselect));
		EditorPrefs.SetBool("ET6", EventDelegate.IsValid(mTrigger.onClick));
		EditorPrefs.SetBool("ET7", EventDelegate.IsValid(mTrigger.onDoubleClick));
		EditorPrefs.SetBool("ET8", EventDelegate.IsValid(mTrigger.onDragOver));
		EditorPrefs.SetBool("ET9", EventDelegate.IsValid(mTrigger.onDragOut));
		EditorPrefs.SetBool("ET10", EventDelegate.IsValid(mTrigger.onCustomRelease));
	}
	void OnPress (bool pressed)
	{
		if (current != null) return;
		current = this;
		if (pressed)
		{
			EventDelegate.Execute(onPress);
			lastPressDownPos = UICamera.lastTouchPosition;
		}
		else 
		{
			EventDelegate.Execute(onRelease);
			if(Vector2.Distance(UICamera.lastTouchPosition, lastPressDownPos) < movementThreshold)
				EventDelegate.Execute(onCustomRelease);
		}
		current = null;
	}
Beispiel #18
0
 private void OnHover(bool isOver)
 {
     if (UIEventTrigger.current != null)
     {
         return;
     }
     UIEventTrigger.current = this;
     if (isOver)
     {
         EventDelegate.Execute(this.onHoverOver);
     }
     else
     {
         EventDelegate.Execute(this.onHoverOut);
     }
     UIEventTrigger.current = null;
 }
Beispiel #19
0
 private void OnSelect(bool selected)
 {
     if (UIEventTrigger.current != null)
     {
         return;
     }
     UIEventTrigger.current = this;
     if (selected)
     {
         EventDelegate.Execute(this.onSelect);
     }
     else
     {
         EventDelegate.Execute(this.onDeselect);
     }
     UIEventTrigger.current = null;
 }
Beispiel #20
0
	void OnDrag (Vector2 delta)
	{
		if (current != null) return;
		current = this;
		EventDelegate.Execute(onDrag);
		current = null;
	}
Beispiel #21
0
	void OnDragOut (GameObject go)
	{
		if (current != null || !isColliderEnabled) return;
		current = this;
		EventDelegate.Execute(onDragOut);
		current = null;
	}
        /// <summary>
        /// 歯車メニューにボタンを追加
        /// </summary>
        /// <param name="name">ボタンオブジェクト名。null可</param>
        /// <param name="label">ツールチップテキスト。null可(ツールチップ非表示)。アイコンへのマウスオーバー時に表示される</param>
        /// <param name="pngData">アイコン画像。null可(システムアイコン使用)。32x32ピクセルのPNGファイル</param>
        /// <param name="action">コールバック。null可(コールバック削除)。アイコンクリック時に呼び出されるコールバック</param>
        /// <returns>生成されたボタンのGameObject</returns>
        /// <example>
        /// ボタン追加例
        /// <code>
        /// public class MyPlugin : UnityInjector.PluginBase {
        ///     void Awake() {
        ///         GearMenu.Buttons.Add(GetType().Name, "テスト", null, GearMenuCallback);
        ///     }
        ///     void GearMenuCallback(GameObject goButton) {
        ///         Debug.LogWarning("GearMenuCallback呼び出し");
        ///     }
        /// }
        /// </code>
        /// </example>
        public static GameObject Add(string name, string label, byte[] pngData, Action <GameObject> action)
        {
            GameObject goButton = null;

            // 既に存在する場合は削除して続行
            if (Contains(name))
            {
                Remove(name);
            }

            if (action == null)
            {
                return(goButton);
            }

            try
            {
                // ギアメニューの子として、コンフィグパネル呼び出しボタンを複製
                goButton = NGUITools.AddChild(Grid, UTY.GetChildObject(Grid, "Config", true));

                // 名前を設定
                if (name != null)
                {
                    goButton.name = name;
                }

                // イベントハンドラ設定(同時に、元から持っていたハンドラは削除)
                EventDelegate.Set(goButton.GetComponent <UIButton>().onClick, () => { action(goButton); });

                // ポップアップテキストを追加
                {
                    UIEventTrigger t = goButton.GetComponent <UIEventTrigger>();
                    EventDelegate.Add(t.onHoverOut, () => { SysShortcut.VisibleExplanation(null, false); });
                    EventDelegate.Add(t.onDragStart, () => { SysShortcut.VisibleExplanation(null, false); });
                    SetText(goButton, label);
                }

                // PNG イメージを設定
                {
                    if (pngData == null)
                    {
                        pngData = DefaultIcon.Png;
                    }

                    // 本当はスプライトを削除したいが、削除するとパネルのα値とのTween同期が動作しない
                    // (動作させる方法が分からない) ので、スプライトを描画しないように設定する
                    // もともと持っていたスプライトを削除する場合は以下のコードを使うと良い
                    //     NGUITools.Destroy(goButton.GetComponent<UISprite>());
                    UISprite us = goButton.GetComponent <UISprite>();
                    us.type       = UIBasicSprite.Type.Filled;
                    us.fillAmount = 0.0f;

                    // テクスチャを生成
                    var tex = new Texture2D(1, 1);
                    tex.LoadImage(pngData);

                    // 新しくテクスチャスプライトを追加
                    UITexture ut = NGUITools.AddWidget <UITexture>(goButton);
                    ut.material             = new Material(ut.shader);
                    ut.material.mainTexture = tex;
                    ut.MakePixelPerfect();
                }

                // グリッド内のボタンを再配置
                Reposition();
            }
            catch
            {
                // 既にオブジェクトを作っていた場合は削除
                if (goButton != null)
                {
                    NGUITools.Destroy(goButton);
                    goButton = null;
                }
                throw;
            }
            return(goButton);
        }
Beispiel #23
0
	void OnDoubleClick ()
	{
		current = this;
		EventDelegate.Execute(onDoubleClick);
		current = null;
	}
    public override void Init()
    {
        base.Init();

        EventDelegate.Set(ToggleFreeJoin.onChange, OnToggleFreeJoin);

        Transform prefab = ListTf.GetChild(0);

        prefab.gameObject.SetActive(false);
        for (int i = 0; i < 9; i++)
        {
            Transform tf = Instantiate(prefab) as Transform;
            tf.parent        = ListTf;
            tf.localPosition = Vector3.zero;
            tf.localScale    = Vector3.one;
        }

        ListTf.GetComponent <UIGrid>().repositionNow = true;

        Transform Rprefab = RankTf.GetChild(0);

        Rprefab.gameObject.SetActive(false);
        for (int i = 0; i < 100; i++)
        {
            Transform tf = Instantiate(Rprefab) as Transform;
            tf.parent        = RankTf;
            tf.localPosition = Vector3.zero;
            tf.localScale    = Vector3.one;
        }

        RankTf.GetComponent <UIGrid>().repositionNow = true;

        GameObject markPrefab = MarkTf.GetChild(0).gameObject;

        ObjectPaging.CreatePagingPanel(MarkTf.parent.gameObject, MarkTf.gameObject, markPrefab
                                       , 5, 32, 32, 10, OnCallBackMark);//가라 522개

        Destroy(markPrefab);


        //무료
        string val = string.Format(_LowDataMgr.instance.GetStringCommon(232), SceneManager.instance.NumberToString(_LowDataMgr.instance.GetEtcTableValue <int>(EtcID.GuildCost2)));

        Popup [0].transform.FindChild("Make/BtnCreateGold/Btn_on/label").GetComponent <UILabel> ().text  = val;
        Popup [0].transform.FindChild("Make/BtnCreateGold/Btn_off/label").GetComponent <UILabel> ().text = val;

        bool create = NetData.instance.GetAsset(AssetType.Gold) < (ulong)_LowDataMgr.instance.GetEtcTableValue <int>(EtcID.GuildCost2) ? false: true;

        Popup[0].transform.FindChild("Make/BtnCreateGold/Btn_on").gameObject.SetActive(create);
        Popup[0].transform.FindChild("Make/BtnCreateGold/Btn_off").gameObject.SetActive(!create);


        EventDelegate.Set(Popup[0].transform.FindChild("Make/BtnCreateGold").GetComponent <UIEventTrigger>().onClick, delegate() {//길드 생성 버튼 클릭.
            ulong needValue = _LowDataMgr.instance.GetEtcTableValue <ulong>(EtcID.GuildCost2);
            if (NetData.instance.GetAsset(AssetType.Gold) < needValue)
            {
                SetClickPopup(443, null, null);
            }
            else if (string.IsNullOrEmpty(CreateName.value)) //길드 이름 확인
            {
                SetClickPopup(237, null, null);
            }
            else if (string.IsNullOrEmpty(CreateDesc.value))//선언 확인
            {
                SetClickPopup(238, null, null);
            }
            else if (IconID <= 0)
            {
                SetClickPopup(239, null, null);
            }
            else //모든란 입력했음.
            {
                //금칙어는 XXX로 나옴
                //string name = CreateName.value;
                //_LowDataMgr.instance.IsBanString(ref name);

                if (_LowDataMgr.instance.IsBanString(CreateName.value))
                {
                    uiMgr.AddPopup(141, 898, 117);
                    return;
                }

                string dec = CreateDesc.value;
                _LowDataMgr.instance.IsBanString(ref dec);
                string noti = CreateNoti.value;
                _LowDataMgr.instance.IsBanString(ref noti);

                //if (_LowDataMgr.instance.IsBanString(CreateName.value))
                //{
                //    uiMgr.AddPopup(141, 898, 117);
                //    return;
                //}
                //if (_LowDataMgr.instance.IsBanString(CreateDesc.value))
                //{
                //    uiMgr.AddPopup(141, 898, 117);
                //    return;
                //}
                //if (_LowDataMgr.instance.IsBanString(CreateNoti.value))
                //{
                //    uiMgr.AddPopup(141, 898, 117);
                //    return;
                //}

                SetClickPopup(236, SceneManager.instance.NumberToString(needValue), () => {                 //SetClickPopup(236, needValue.ToString("#,##"), () => {
                    NetworkClient.instance.SendPMsgGuildCreateNewC(IconID, CreateName.value, dec, 2, 2);
                    //IsCreateGuild = true;
                });
            }
        });
        //유료
        //string val2 = string.Format(_LowDataMgr.instance.GetStringCommon(231), _LowDataMgr.instance.GetEtcTableValue<int>(EtcID.GuildCost1).ToString("#,##"));
        string val2 = string.Format(_LowDataMgr.instance.GetStringCommon(231), SceneManager.instance.NumberToString(_LowDataMgr.instance.GetEtcTableValue <int>(EtcID.GuildCost1)));

        Popup[0].transform.FindChild("Make/BtnCreateCash/Btn_on/label").GetComponent <UILabel>().text  = val2;
        Popup[0].transform.FindChild("Make/BtnCreateCash/Btn_off/label").GetComponent <UILabel>().text = val2;


        bool create_ = NetData.instance.GetAsset(AssetType.Gold) < (ulong)_LowDataMgr.instance.GetEtcTableValue <int>(EtcID.GuildCost1) ? false : true;

        Popup[0].transform.FindChild("Make/BtnCreateCash/Btn_on").gameObject.SetActive(create_);
        Popup[0].transform.FindChild("Make/BtnCreateCash/Btn_off").gameObject.SetActive(!create_);



        EventDelegate.Set(Popup[0].transform.FindChild("Make/BtnCreateCash").GetComponent <UIEventTrigger>().onClick, delegate() {//길드 생성 버튼 클릭.
            ulong needValue = _LowDataMgr.instance.GetEtcTableValue <ulong>(EtcID.GuildCost1);
            if (NetData.instance.GetAsset(AssetType.Cash) < needValue)
            {
                SetClickPopup(376, null, null);
            }
            else if (System.Text.ASCIIEncoding.Unicode.GetByteCount(CreateName.value) > 24)  //길드이름 글자수제한
            {
            }
            else if (string.IsNullOrEmpty(CreateName.value))//길드 이름 확인
            {
                SetClickPopup(237, null, null);
            }
            else if (string.IsNullOrEmpty(CreateDesc.value))//선언 확인
            {
                SetClickPopup(238, null, null);
            }
            else if (IconID <= 0)
            {
                SetClickPopup(239, null, null);
            }

            else //모든란 입력했음.
            {
                //금칙어
                //string name = CreateName.value;
                //_LowDataMgr.instance.IsBanString(ref name);

                if (_LowDataMgr.instance.IsBanString(CreateName.value))
                {
                    uiMgr.AddPopup(141, 898, 117);
                    return;
                }
                string dec = CreateDesc.value;
                _LowDataMgr.instance.IsBanString(ref dec);
                string noti = CreateNoti.value;
                _LowDataMgr.instance.IsBanString(ref noti);
                //if (_LowDataMgr.instance.IsBanString(CreateName.value))
                //{
                //    uiMgr.AddPopup(141, 898, 117);
                //    return;
                //}
                //if (_LowDataMgr.instance.IsBanString(CreateDesc.value))
                //{
                //    uiMgr.AddPopup(141, 898, 117);
                //    return;
                //}
                //if (_LowDataMgr.instance.IsBanString(CreateNoti.value))
                //{
                //    uiMgr.AddPopup(141, 898, 117);
                //    return;
                //}

                SetClickPopup(235, SceneManager.instance.NumberToString(needValue), () => {                 //SetClickPopup(235, needValue.ToString("#,##"), ()=> {
                    NetworkClient.instance.SendPMsgGuildCreateNewC(IconID, CreateName.value, dec, 2, 1);
                    //IsCreateGuild = true;
                });
            }
        });

        //다음버튼 ( 휘장선택후 다시 생성화면으로 넘어감)
        EventDelegate.Set(Popup[0].transform.FindChild("Select/BtnCreate").GetComponent <UIEventTrigger>().onClick, delegate() {
            if (!CheckLevel)
            {
                SetClickPopup(945, _LowDataMgr.instance.GetEtcTableValue <string>(EtcID.GuildCondition), null);
            }
            else
            {
                //CreateGuild();
                if (0 < IconID)
                {
                    CreateGuild();
                }
                else//길드 마크를 선택하지 않음.
                {
                    SetClickPopup(239, null, null);
                }
            }
        });

        //휘장마크 선택팝업 끄기
        EventDelegate.Set(Popup[0].transform.FindChild("BtnClose").GetComponent <UIEventTrigger>().onClick, () => {
            ActivePopups(99);
            IconID = 0;
        });

        //메인팝업
        EventDelegate.Set(Popup[1].transform.FindChild("BtnClose").GetComponent <UIEventTrigger>().onClick, () => {
            ActivePopups(99);
            uiMgr.SetTopMenuTitleName(215);
        });

        //메세지 팝업
        EventDelegate.Set(Popup[2].transform.FindChild("BtnCancel").GetComponent <UIEventTrigger>().onClick, () => {
            Popup[2].SetActive(false);
        });

        //길드 생성 버튼
        transform.FindChild("BtnCreate/Btn_on/bg").GetComponent <UISprite>().spriteName = CheckLevel ? "Btn_Blue02" : "Btn_Blue02Dis";
        EventDelegate.Set(transform.FindChild("BtnCreate").GetComponent <UIEventTrigger>().onClick, () => {
            if (!CheckLevel)
            {
                SetClickPopup(945, _LowDataMgr.instance.GetEtcTableValue <string>(EtcID.GuildCondition), null);
                return;
            }

            //던에따라..ㅇㄹㅇㄹ
            bool createCash  = NetData.instance.GetAsset(AssetType.Cash) >= _LowDataMgr.instance.GetEtcTableValue <ulong>(EtcID.GuildCost1);
            bool createMoney = NetData.instance.GetAsset(AssetType.Gold) >= _LowDataMgr.instance.GetEtcTableValue <ulong>(EtcID.GuildCost2);

            Popup[0].transform.FindChild("Make/BtnCreateCash/Btn_on").gameObject.SetActive(createCash);
            Popup[0].transform.FindChild("Make/BtnCreateCash/Btn_off").gameObject.SetActive(!createCash);

            Popup[0].transform.FindChild("Make/BtnCreateGold/Btn_on").gameObject.SetActive(createMoney);
            Popup[0].transform.FindChild("Make/BtnCreateGold/Btn_off").gameObject.SetActive(!createMoney);

            ActivePopups(0);

            //여기서 생성화면으로 ..
            Popup[0].transform.FindChild("Select").gameObject.SetActive(false);
            Popup[0].transform.FindChild("Make").gameObject.SetActive(true);

            CreateName.value = CreateName.label.text = "";
            CreateDesc.value = CreateDesc.label.text = "";
            CreateNoti.value = CreateNoti.label.text = "";

            Popup[0].transform.FindChild("Make/Txt_master").GetComponent <UILabel>().text = NetData.instance.GetUserInfo()._charName;//내 캐릭이 길드장이 됨.


            IconID = 0;
            Popup[0].transform.FindChild("Make/Guildmark/icon").GetComponent <UISprite>().spriteName = "";
            UIEventTrigger etri = Popup[0].transform.FindChild("Make/Guildmark/icon").GetComponent <UIEventTrigger>();
            EventDelegate.Set(etri.onClick, delegate()
            {
                for (int i = 0; i < MarkTf.childCount; i++)
                {
                    GameObject sel = MarkTf.GetChild(i).FindChild("Cover").gameObject;
                    sel.SetActive(false);
                }

                //휘장선택창
                Popup[0].transform.FindChild("Select").gameObject.SetActive(true);
                Popup[0].transform.FindChild("Make").gameObject.SetActive(false);
            });
        });

        //검색
        EventDelegate.Set(transform.FindChild("Search/Btn_search").GetComponent <UIEventTrigger>().onClick, () => {
            Debug.Log("SearchGuild Name = " + SearchGuild.value);
            RecommendList.Clear();
            NetworkClient.instance.SendPMsgGuildSearchGuildC(SearchGuild.value);
        });

        //다시 재검색
        EventDelegate.Set(transform.FindChild("Search/Btn_reset").GetComponent <UIEventTrigger>().onClick, () => {
            for (int j = 0; j < ListTf.childCount; j++)
            {
                ListTf.GetChild(j).transform.FindChild("Cover").gameObject.SetActive(false);
            }

            if (TabObj[1].activeSelf)//추천길드 리스트
            {
                NetworkClient.instance.SendPMsgGuildRecommendListC();
            }
        });

        SearchGuild.label.text = SearchGuild.value = "";
        NotFoundGuildName.text = "";
        CreateName.value       = CreateName.label.text = "";
        CreateDesc.value       = CreateDesc.label.text = "";
        CreateNoti.value       = CreateNoti.label.text = "";

        ActivePopups(99); //전부끄기

        if (CheckLevel)   //레벨이 부족할 경우 무시.(신청한것이 없을 테니까)
        {
            NetworkClient.instance.SendPMsgGuildQueryGuildListC();
        }

        UITabGroup tabGroup = transform.FindChild("TabBtnList").GetComponent <UITabGroup>();

        tabGroup.Initialize(delegate(int arr) {
            for (int i = 0; i < TabObj.Length; i++)
            {
                TabObj[i].SetActive(i == arr);
            }

            if (arr == 0)//랭킹
            {
                RankingList.Clear();
                NetworkClient.instance.SendPMsgRankGuildQueryC((int)Sw.RANK_TYPE.RANK_TYPE_GUILD_LEVEL);
            }
            else if (arr == 1)//길드 리스트
            {
                NetworkClient.instance.SendPMsgGuildRecommendListC();
            }
        });
    }
    public void RankingView(int cnt, List <NetData.RankInfo> RankList)
    {
        RankScroll.gameObject.SetActive(RankList.Count > 0 ? true : false);
        if (!RankScroll.gameObject.activeSelf)
        {
            uiMgr.AddPopup(141, 901, 117);
            return;
        }

        //최초호출시 스크롤뷰를 갱신
        if (totalCnt == 0)
        {
            RankScroll.ResetPosition();
        }

        //여러번 호출되기때문에 누적시켜줌
        totalCnt += cnt;
        // 맨처음 호출될때는 0번째슬롯부터 다음부터는 마지막생성된 슬롯부터~ 시작
        for (int i = slotCnt == 0 ? 0 : slotCnt; i < RankTf.childCount; i++)
        {
            if (i >= totalCnt)
            {
                RankTf.transform.GetChild(i).gameObject.SetActive(false);
                continue;
            }

            GameObject slotGo = RankTf.GetChild(i).gameObject;
            Transform  slotTf = slotGo.transform;

            slotGo.SetActive(true);

            NetData.RankInfo info = RankingList[i];

            UISprite icon = slotTf.FindChild("Mark").GetComponent <UISprite>();
            UILabel  name = slotTf.FindChild("Txt_guildname").GetComponent <UILabel>();
            UILabel  rank = slotTf.FindChild("Txt_ranking").GetComponent <UILabel>();

            icon.spriteName = _LowDataMgr.instance.GetLowDataIcon((uint)info.RoleType);
            name.text       = info.Name;
            rank.text       = string.Format(_LowDataMgr.instance.GetStringCommon(522), info.Rank.ToString());

            //길드 가입신청

            bool isJoinGuild = false;
            for (int j = 0; j < JoinList.Count; j++)
            {
                if (JoinList[j] != info.Id)
                {
                    continue;
                }

                isJoinGuild = true;
                break;
            }

            int idx = i;

            UIEventTrigger etri = slotTf.GetComponent <UIEventTrigger>();
            EventDelegate.Set(etri.onClick, delegate()
            {
                //선택
                for (int j = 0; j < RankTf.childCount; j++)
                {
                    RankTf.GetChild(j).transform.FindChild("Cover").gameObject.SetActive(j == idx);
                }
            });

            //가입신청버튼은 세종류로.
            //가입신청(215)
            //가입취소(가입승인 대기상태)(233)//
            //가입불가능(레벨불만족일경우)
            //slotTf.FindChild("Btn_join").GetComponent<UISprite>().spriteName = isJoinGuild ? "Btn_Blue01Dis" : "Btn_Blue01";
            slotTf.FindChild("Btn_join/label").GetComponent <UILabel>().text  = _LowDataMgr.instance.GetStringCommon((uint)(isJoinGuild ? 233 : 215));
            slotTf.FindChild("Btn_join").GetComponent <UISprite>().spriteName = CheckLevel ? "Btn_Blue01" : "Btn_Blue01Dis";

            EventDelegate.Set(slotTf.FindChild("Btn_join").GetComponent <UIButton>().onClick, delegate()
            {
                //선택
                for (int j = 0; j < RankTf.childCount; j++)
                {
                    RankTf.GetChild(j).transform.FindChild("Cover").gameObject.SetActive(j == idx);
                }
                if (CheckLevel)
                {
                    NetworkClient.instance.SendPMsgGuildApplyGuildC((uint)info.Id, (uint)(isJoinGuild ? 2 : 1));//1가입 2 취소
                }
                else
                {
                    SetClickPopup(945, _LowDataMgr.instance.GetEtcTableValue <string>(EtcID.GuildCondition), null);
                }
                //SetClickPopup(171, null, null);
            });

            //길드정보보기
            EventDelegate.Set(slotTf.FindChild("Btn_search").GetComponent <UIEventTrigger>().onClick, delegate() {
                //선택
                for (int j = 0; j < RankTf.childCount; j++)
                {
                    RankTf.GetChild(j).transform.FindChild("Cover").gameObject.SetActive(j == idx);
                }

                NetworkClient.instance.SendPMsgGuildQueryBaseInfoC((uint)info.Id);
            });
        }
        RankTf.GetComponent <UIGrid>().Reposition();
    }
Beispiel #26
0
 private void OnPress(bool pressed)
 {
     if (UIEventTrigger.current != null)
     {
         return;
     }
     UIEventTrigger.current = this;
     if (pressed)
     {
         EventDelegate.Execute(this.onPress);
     }
     else
     {
         EventDelegate.Execute(this.onRelease);
     }
     UIEventTrigger.current = null;
 }
Beispiel #27
0
 protected override void BindEvents()
 {
     base.BindEvents();
     UIEventTrigger.Get(m_cBtnReturn.gameObject).AddListener(UnityEngine.EventSystems.EventTriggerType.PointerClick, OnClickReturn);
     UIEventTrigger.Get(m_cBtnReturn.gameObject).AddListener(UnityEngine.EventSystems.EventTriggerType.PointerClick, OnClickAgain);
 }
Beispiel #28
0
    void Start()
    {
        ActionController = GameObject.FindGameObjectWithTag("Player").GetComponent <AudioSource>();
        Hpba             = GameObject.Find("HpbaBg").GetComponent <UIProgressBar>();
        boast            = GameObject.Find("BoastingBg").GetComponent <UIProgressBar>();
        Fireicon         = GameObject.Find("Fireicon").GetComponent <UISprite>();
        PosionIcon       = GameObject.Find("Posionicon").GetComponent <UISprite>();
        Slowicon         = GameObject.Find("Slowicon").GetComponent <UISprite>();
        win              = GameObject.Find("Win Label").GetComponent <UILabel>();
        Lose             = GameObject.Find("Lose Label").GetComponent <UILabel>();
        hitted2          = GameObject.Find("BloodTexture").GetComponent <UITexture>();
        btm              = GameObject.Find("Outbtm").GetComponent <UISprite>();
        btmlabel         = GameObject.Find("OutLabel").GetComponent <UILabel>();
        win.enabled      = false;
        Lose.enabled     = false;
        hitted2.enabled  = false;
        btm.enabled      = false;
        btmlabel.enabled = false;

        GameObject.Find("UiManeger").GetComponent <Btmmanger>().PlayerSound = GameObject.FindGameObjectWithTag("Player").GetComponent <AudioSource>();
        //ActionController = GameObject.FindGameObjectWithTag("Player").GetComponent<AudioSource>();
        BgmManmeger.Instance.ActionController = GameObject.FindGameObjectWithTag("Player").GetComponent <AudioSource>();
        v                        = transform.forward;
        AniControll              = GetComponent <Animator>();
        basespd                  = spd;
        iv                       = GetComponentInChildren <Inventory>();
        iv.p                     = this;
        frontweaponbtn           = GameObject.Find("Frontweapon").GetComponent <UIButton>();
        backweaponbtn            = GameObject.Find("Backweapon").GetComponent <UIButton>();
        pickbtn                  = GameObject.Find("Pickupbtn").GetComponent <UIButton>();
        firebtn                  = GameObject.Find("Firebtn").GetComponent <UIEventTrigger>();
        stick                    = GameObject.Find("handle").GetComponent <UIJoystick>();
        stick.pl                 = this;
        pv                       = GetComponent <PhotonView>();
        t                        = GetComponent <Transform>();
        pv.ObservedComponents[0] = this;
        //카메라 할당
        if (pv.isMine)
        {
            GameObject.Find("Main Camera").GetComponent <SmoothFollow>().target = t;
            gameObject.tag = "Player";
        }
        else
        {
            GetComponent <AudioListener>().enabled = false;
            gameObject.tag = "Enemy";
            a.tag          = "a";
            b.tag          = "a";
        }
        //버튼 동적 할당
        fireon  = new EventDelegate(this, "Firebtnon");
        fireoff = new EventDelegate(this, "Firebtnoff");
        firebtn.onPress.Add(fireon);
        firebtn.onRelease.Add(fireoff);
        picking = new EventDelegate(this, "Pickupitem");
        pickbtn.onClick.Add(picking);
        cngbw = new EventDelegate(this, "Backweapon");
        backweaponbtn.onClick.Add(cngbw);
        cngfw = new EventDelegate(this, "Frontweapon");
        frontweaponbtn.onClick.Add(cngfw);
    }
Beispiel #29
0
        // Use this for initialization
        private void Start()
        {
            //			//
            //			m_TweenPosition  = this.GetComponent<TweenPosition>();
            //
            //			if( m_TweenPosition == null )
            //			{
            //				Debug.LogError( "There's not a Component:'TweenPosition'.", this );
            //				return;
            //			}

            m_EventTrigger = this.GetComponent<UIEventTrigger>();

            if( m_EventTrigger == null )
            {
                Debug.LogError("There's not a compoment:'UIEventTrigger'.",this);
                return;
            }

            //
            if( m_ToolTip == null )
                Debug.LogWarning( "The ToolTip has not assigned.", this );

            EventDelegate.Add(m_EventTrigger.onClick,this.OnClick);

            //EventDelegate.Add(m_EventTrigger.onDragOver,this.OnDragOver);

            //
            m_bInit = true;
        }
Beispiel #30
0
 public static void AddCallback(this UIEventTrigger button, EventDelegate.Callback callback)
 {
     EventDelegate.Add(button.onClick, callback);
 }