public void UpdateMechanicPreview(bool missionInProgress, JamGarrisonMobileMission mission)
 {
     if (this.m_previewMechanicsGroup != null)
     {
         AbilityDisplay[] componentsInChildren = this.m_previewMechanicsGroup.GetComponentsInChildren <AbilityDisplay>(true);
         for (int i = 0; i < componentsInChildren.Length; i++)
         {
             if (componentsInChildren[i] != null)
             {
                 Object.DestroyImmediate(componentsInChildren[i].get_gameObject());
             }
         }
     }
     if (!missionInProgress)
     {
         for (int j = 0; j < mission.Encounter.Length; j++)
         {
             int             id     = (mission.Encounter[j].MechanicID.Length <= 0) ? 0 : mission.Encounter[j].MechanicID[0];
             GarrMechanicRec record = StaticDB.garrMechanicDB.GetRecord(id);
             if (record != null && record.GarrAbilityID != 0)
             {
                 GameObject gameObject = Object.Instantiate <GameObject>(this.m_previewMechanicEffectPrefab);
                 gameObject.get_transform().SetParent(this.m_previewMechanicsGroup.get_transform(), false);
                 AbilityDisplay component = gameObject.GetComponent <AbilityDisplay>();
                 component.SetAbility(record.GarrAbilityID, false, false, null);
                 FollowerCanCounterMechanic canCounterStatus = GeneralHelpers.HasFollowerWhoCanCounter((int)record.GarrMechanicTypeID);
                 component.SetCanCounterStatus(canCounterStatus);
             }
         }
     }
 }
Exemple #2
0
 public void SetCanCounterStatus(FollowerCanCounterMechanic canCounterStatus)
 {
     if (this.m_canCounterMechanicIcon == null || this.m_canCounterMechanicButBusyIcon == null)
     {
         return;
     }
     this.m_canCounterMechanicIcon.get_gameObject().SetActive(canCounterStatus == FollowerCanCounterMechanic.yesAndAvailable);
     this.m_canCounterMechanicButBusyIcon.get_gameObject().SetActive(canCounterStatus == FollowerCanCounterMechanic.yesButBusy);
 }