Example #1
0
 public void OnUnitClick(int cityID)
 {
     if (this.cityCurrentUnitKey == 0 || !this.cityUnitDic.ContainsKey(cityID) || this.cityCurrentUnitKey == cityID)
     {
         EventDispatcher.Broadcast <int>(CityManagerEvent.ChangeCityByIntegrationHearth, cityID);
     }
     else
     {
         WaitingUIView waitingUIView = UIManagerControl.Instance.OpenUI("WaitingUI", null, false, UIType.NonPush) as WaitingUIView;
         waitingUIView.SetAlpha(0f);
         string text = this.cityCurrentUnitKey + "To" + cityID;
         if (!this.cityPathPointPositionDic.ContainsKey(text))
         {
             this.CreatePath(text, this.cityUnitDic.get_Item(this.cityCurrentUnitKey).get_transform(), this.cityUnitDic.get_Item(cityID).get_transform());
         }
         this.PlayPathAnima(text, delegate
         {
             if (WaitingUIView.Instance != null)
             {
                 waitingUIView.SetAlpha(1f);
                 WaitingUIView.Instance.Show(false);
             }
             EventDispatcher.Broadcast <int>(CityManagerEvent.ChangeCityByIntegrationHearth, cityID);
         });
     }
 }
Example #2
0
 private void Awake()
 {
     WaitingUIView.Instance = this;
     base.AwakeBase(BindingContext.BindingContextMode.MonoBinding, false);
     this.maskImage = base.FindTransform("Mask").GetComponent <Image>();
 }