Esempio n. 1
0
    private void OnEnable()
    {
        if (Main.instance == null)
        {
            return;
        }
        if (this.m_followerID > 0)
        {
            if (!PersistentFollowerData.followerDictionary.ContainsKey(this.m_followerID))
            {
                base.transform.SetParent(Main.instance.transform);
                base.gameObject.SetActive(false);
                return;
            }
            this.SetAvailabilityStatus(PersistentFollowerData.followerDictionary[this.m_followerID]);
        }
        Main instance = Main.instance;

        instance.FollowerDataChangedAction = (Action)Delegate.Combine(instance.FollowerDataChangedAction, new Action(this.FollowerDataChanged));
        Main instance2 = Main.instance;

        instance2.UseArmamentResultAction = (Action <int, JamGarrisonFollower, JamGarrisonFollower>)Delegate.Combine(instance2.UseArmamentResultAction, new Action <int, JamGarrisonFollower, JamGarrisonFollower>(this.HandleUseArmamentResult));
        if (AdventureMapPanel.instance != null)
        {
            AdventureMapPanel instance3 = AdventureMapPanel.instance;
            instance3.OnMissionFollowerSlotChanged = (Action <int, bool>)Delegate.Combine(instance3.OnMissionFollowerSlotChanged, new Action <int, bool>(this.OnMissionFollowerSlotChanged));
            AdventureMapPanel instance4 = AdventureMapPanel.instance;
            instance4.DeselectAllFollowerListItemsAction = (Action)Delegate.Combine(instance4.DeselectAllFollowerListItemsAction, new Action(this.DeselectMe));
        }
        if (this.m_followerDetailView != null && OrderHallFollowersPanel.instance != null)
        {
            OrderHallFollowersPanel instance5 = OrderHallFollowersPanel.instance;
            instance5.FollowerDetailListItemSelectedAction = (Action <int>)Delegate.Combine(instance5.FollowerDetailListItemSelectedAction, new Action <int>(this.DetailFollowerListItem_ManageFollowerDetailViewSize));
        }
    }
Esempio n. 2
0
    private void OnDisable()
    {
        Main instance = Main.instance;

        instance.FollowerDataChangedAction = (Action)Delegate.Remove(instance.FollowerDataChangedAction, new Action(this.FollowerDataChanged));
        Main instance2 = Main.instance;

        instance2.UseArmamentResultAction = (Action <int, JamGarrisonFollower, JamGarrisonFollower>)Delegate.Remove(instance2.UseArmamentResultAction, new Action <int, JamGarrisonFollower, JamGarrisonFollower>(this.HandleUseArmamentResult));
        if (AdventureMapPanel.instance != null)
        {
            AdventureMapPanel instance3 = AdventureMapPanel.instance;
            instance3.OnMissionFollowerSlotChanged = (Action <int, bool>)Delegate.Remove(instance3.OnMissionFollowerSlotChanged, new Action <int, bool>(this.OnMissionFollowerSlotChanged));
            AdventureMapPanel instance4 = AdventureMapPanel.instance;
            instance4.DeselectAllFollowerListItemsAction = (Action)Delegate.Remove(instance4.DeselectAllFollowerListItemsAction, new Action(this.DeselectMe));
        }
        if (this.m_followerDetailView != null && OrderHallFollowersPanel.instance != null)
        {
            OrderHallFollowersPanel instance5 = OrderHallFollowersPanel.instance;
            instance5.FollowerDetailListItemSelectedAction = (Action <int>)Delegate.Remove(instance5.FollowerDetailListItemSelectedAction, new Action <int>(this.DetailFollowerListItem_ManageFollowerDetailViewSize));
        }
    }
 private void Awake()
 {
     OrderHallFollowersPanel.instance = this;
 }