void OnClicTeamType(ButtonScript obj, object args, int param1, int param2) { minsLevel = 1; typeTeam = (TeamType)param1; GetminLevel(typeTeam); //GlobalValue.Get((Constant)param1, out minsLevel); if (typeTeam == TeamType.TT_None) { leftLevel = 1; } else { leftLevel = minsLevel; } InitLevelLeft(rightLevel - leftLevel + 1); TeamTargetCell tcell = obj.GetComponent <TeamTargetCell>(); if (_tcell != null) { _tcell.iconSp.gameObject.SetActive(false); } _tcell = tcell; tcell.iconSp.gameObject.SetActive(true); UICenterOnIndex CenterOnIndex = grid_leftlevel.GetComponent <UICenterOnIndex>(); CenterOnIndex.UpdateItemPosition(0); isTarget = true; }
void OnClicTeamType(ButtonScript obj, object args, int param1, int param2) { typeTeam = (TeamType)param1; TeamTargetCell tcell = obj.GetComponent <TeamTargetCell>(); if (curCell != null) { curCell.iconSp.gameObject.SetActive(false); } curCell = tcell; tcell.iconSp.gameObject.SetActive(true); RefreshTeamTypeMenbers(typeTeam); }
void Start() { //_CreateTitleLable.text = LanguageManager.instance.GetValue("Team_CreateTitle") //vipmanger = grid_leftlevel.GetComponent<VIPPackageItemManager> (); item_leftlevel.SetActive(false); item_rightlevel.SetActive(false); UIManager.SetButtonEventHandler(CloseBtn.gameObject, EnumButtonEvent.OnClick, OnClicClose, 0, 0); UIManager.SetButtonEventHandler(CreateBtn.gameObject, EnumButtonEvent.OnClick, OnClicCreate, 0, 0); item_target.SetActive(false); typeTeam = TeamType.TT_None; for (TeamType i = TeamType.TT_None; i < TeamType.TT_Max; ++i) { GameObject obj = GameObject.Instantiate(item_target) as GameObject; obj.SetActive(true); obj.transform.parent = grid_target.transform; obj.transform.localScale = Vector3.one; obj.transform.localPosition = Vector3.zero; obj.name = Enum.GetName(typeof(TeamType), i); UIManager.SetButtonEventHandler(obj, EnumButtonEvent.OnClick, OnClicTeamType, (int)Enum.Parse(typeof(TeamType), Enum.GetName(typeof(TeamType), i)), 0); obj.GetComponent <TeamTargetCell>().nameLabel.text = LanguageManager.instance.GetValue(Enum.GetName(typeof(TeamType), i)); if (i == typeTeam) { _tcell = obj.GetComponent <TeamTargetCell>(); obj.GetComponent <TeamTargetCell>().iconSp.gameObject.SetActive(true); } else { obj.GetComponent <TeamTargetCell>().iconSp.gameObject.SetActive(false); } } TeamSystem.OnChangeTeam += HideSelf; centerLeft = grid_leftlevel.GetComponent <UICenterOnChild> (); centerLeft.onFinished += OnCenterLeftFinished; centerright = grid_rightlevel.GetComponent <UICenterOnChild> (); centerright.onFinished += OnCenterrightFinished; UIScrollView sc = grid_leftlevel.GetComponentInParent <UIScrollView>(); sc.onDragMoveed = scrollveiwMove; GlobalValue.Get(Constant.C_PlayerMaxLevel, out maxLevel); rightLevel = (int)maxLevel; //VIPPackageItemManager.ScrollviewEventOk += ScrollviewOk; rightScro.onDragFinished += ScrollviewOk; leftScro.onDragFinished += ScrollviewOk; InitLevelLeft(rightLevel - leftLevel + 1); InitLevelRight(rightLevel); }
public void AddtargetItems() { for (TeamType i = TeamType.TT_None; i < TeamType.TT_Max; ++i) { GameObject obj = GameObject.Instantiate(target_item) as GameObject; obj.SetActive(true); obj.transform.parent = target_Grid.transform; obj.transform.localScale = Vector3.one; obj.transform.localPosition = Vector3.zero; obj.name = Enum.GetName(typeof(TeamType), i); UIManager.SetButtonEventHandler(obj, EnumButtonEvent.OnClick, OnClicTeamType, (int)Enum.Parse(typeof(TeamType), Enum.GetName(typeof(TeamType), i)), 0); obj.GetComponent <TeamTargetCell>().nameLabel.text = LanguageManager.instance.GetValue(Enum.GetName(typeof(TeamType), i)); if (i == typeTeam) { curCell = obj.GetComponent <TeamTargetCell>(); obj.GetComponent <TeamTargetCell>().iconSp.gameObject.SetActive(true); } else { obj.GetComponent <TeamTargetCell>().iconSp.gameObject.SetActive(false); } } }