private void AllDone() { Vector3 zero = Vector3.zero; for (int i = 0; i < this.m_RewardPackages.Count; i++) { RewardPackageData data = this.m_RewardPackages[i]; zero += data.m_TargetBone.position; } this.m_DoneButton.transform.position = (Vector3)(zero / ((float)this.m_RewardPackages.Count)); this.m_DoneButton.gameObject.SetActive(true); this.m_DoneButton.SetText(GameStrings.Get("GLOBAL_DONE")); Spell component = this.m_DoneButton.m_button.GetComponent <Spell>(); component.AddFinishedCallback(new Spell.FinishedCallback(this.OnDoneButtonShown)); component.ActivateState(SpellStateType.BIRTH); }
public void AnimateRewards() { int count = this.m_Rewards.Count; this.m_RewardPackages = this.GetPackageData(count); this.m_RewardObjects = new GameObject[count]; for (int i = 0; i < this.m_RewardPackages.Count; i++) { RewardPackageData data = this.m_RewardPackages[i]; if (data.m_TargetBone == null) { UnityEngine.Debug.LogWarning("RewardBoxesDisplay: AnimateRewards package target bone is null!"); return; } if (i >= this.m_RewardObjects.Length) { UnityEngine.Debug.LogWarning("RewardBoxesDisplay: AnimateRewards reward index exceeded!"); return; } this.m_RewardObjects[i] = this.CreateRewardInstance(i, data.m_TargetBone.position, false); } this.RewardPackageAnimation(); }