private void OnJobIconClick(AnimatedToggle toggle) { if (this.OnChangeJobSlot == null) { return; } this.OnChangeJobSlot(this.mJobSlots.IndexOf(toggle)); GameParameter.UpdateAll(this.JobNameObject); }
public void Initalize() { if (this.IsInitalized) { return; } if (Object.op_Inequality((Object)this.TouchArea, (Object)null)) { TouchControlArea component = (TouchControlArea)this.TouchArea.GetComponent <TouchControlArea>(); if (Object.op_Inequality((Object)component, (Object)null)) { this.mTouchControlArea = component; } } if (Object.op_Inequality((Object)this.BackButton, (Object)null)) { // ISSUE: method pointer ((UnityEvent)this.BackButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(OnBack))); } if (Object.op_Inequality((Object)this.SkinButton, (Object)null)) { // ISSUE: method pointer ((UnityEvent)this.SkinButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(OnSkinSelectClick))); } if (Object.op_Inequality((Object)this.ReactionButton, (Object)null)) { // ISSUE: method pointer ((UnityEvent)this.ReactionButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(OnRectionClick))); } if (Object.op_Inequality((Object)this.VoiceButton, (Object)null)) { // ISSUE: method pointer ((UnityEvent)this.VoiceButton.get_onClick()).AddListener(new UnityAction((object)this, __methodptr(OnVoiceClick))); } if (Object.op_Inequality((Object)this.VoiceUnlock, (Object)null)) { this.VoiceUnlock.SetActive(true); } if (Object.op_Inequality((Object)this.JobIconTemplate_Normal, (Object)null)) { ((Component)this.JobIconTemplate_Normal).get_gameObject().SetActive(false); } if (Object.op_Inequality((Object)this.JobIconTemplate_CC, (Object)null)) { ((Component)this.JobIconTemplate_CC).get_gameObject().SetActive(false); } for (int index = 0; index < 4; ++index) { AnimatedToggle animatedToggle1 = (AnimatedToggle)Object.Instantiate <AnimatedToggle>((M0)this.JobIconTemplate_Normal); ((Component)animatedToggle1).get_gameObject().SetActive(false); ((Component)animatedToggle1).get_transform().SetParent((Transform)this.JobIconParent, false); animatedToggle1.OnClick = new AnimatedToggle.ClickEvent(this.OnJobIconClick); this.mJobIcons.Add(animatedToggle1); AnimatedToggle animatedToggle2 = (AnimatedToggle)Object.Instantiate <AnimatedToggle>((M0)this.JobIconTemplate_CC); ((Component)animatedToggle2).get_gameObject().SetActive(false); ((Component)animatedToggle2).get_transform().SetParent((Transform)this.JobIconParent, false); animatedToggle2.OnClick = new AnimatedToggle.ClickEvent(this.OnJobIconClick); this.mCCIcons.Add(animatedToggle2); } this.IsInitalized = true; }
public void Refresh(UnitData unit) { if (unit == null) { return; } DataSource.Bind <UnitData>(((Component)this).get_gameObject(), unit); int index1 = 0; int index2 = 0; this.mJobSlots.Clear(); Toggle.ToggleEvent toggleEvent = new Toggle.ToggleEvent(); for (int jobNo = 0; jobNo < unit.Jobs.Length; ++jobNo) { JobData job = unit.Jobs[jobNo]; if (job != null && job.Param != null) { if (unit.IsJobAvailable(jobNo)) { this.mJobSlots.Add(this.mJobIcons[index1]); ++index1; } else { this.mJobSlots.Add(this.mCCIcons[index2]); ++index2; } AnimatedToggle mJobIcon = this.mJobIcons[this.mJobSlots.Count - 1]; DataSource.Bind <JobData>(((Component)mJobIcon).get_gameObject(), unit.Jobs[jobNo]); ((Component)mJobIcon).get_gameObject().SetActive(true); ((Selectable)mJobIcon).set_interactable(unit.CheckJobUnlockable(jobNo)); Toggle.ToggleEvent onValueChanged = (Toggle.ToggleEvent)mJobIcon.onValueChanged; mJobIcon.onValueChanged = (__Null)toggleEvent; mJobIcon.set_isOn(jobNo == unit.JobIndex); mJobIcon.onValueChanged = (__Null)onValueChanged; ((Animator)((Component)mJobIcon).GetComponent <Animator>()).SetBool(this.JobIconUnlockBool, job.IsActivated); } } for (int index3 = index2; index3 < this.mCCIcons.Count; ++index3) { ((Component)this.mCCIcons[index3]).get_gameObject().SetActive(false); } for (int index3 = index1; index3 < this.mJobIcons.Count; ++index3) { ((Component)this.mJobIcons[index3]).get_gameObject().SetActive(false); } if (Object.op_Inequality((Object)this.SkinButton, (Object)null)) { ((Selectable)this.SkinButton).set_interactable(unit.IsSkinUnlocked()); } DataSource.Bind <UnitData>(this.JobNameObject, unit); bool flag = true; for (int index3 = 0; index3 < this.mJobSlots.Count; ++index3) { this.mJobSlots[index3].set_isOn(unit.JobIndex == index3); Animator component = (Animator)((Component)this.mJobSlots[index3]).GetComponent <Animator>(); int num = 0; do { component.Update(!flag ? 0.0f : 1f); ++num; }while (component.IsInTransition(0) && num < 10); } if (Object.op_Inequality((Object)this.VoiceButton, (Object)null) && Object.op_Inequality((Object)this.VoiceUnlock, (Object)null)) { this.VoiceUnlock.SetActive(!unit.CheckUnlockPlaybackVoice()); } GameParameter.UpdateAll(((Component)this).get_gameObject()); }