Пример #1
0
        // Start is called before the first frame update
        //void Start()
        //{
        //    Initialize();
        //}

        public void Initialize()
        {
            InputKeeper.Instance.OnRightClickPos += ForceMove;

            //Tent tent1 = new Tent();
            //tent1.GangID = GangID;
            //tent1.Location = Location;
            //tent1.Initialize();
            //AddTent(tent1);

            //Tent tent2 = new Tent();
            //tent2.GangID = GangID;
            //tent2.Location = Location;
            //tent2.Initialize();
            //AddTent(tent2);

            for (int i = 0; i < SoldierCfgIDs.Count; i++)
            {
                Tent tent1 = new Tent();
                tent1.GangID   = GangID;
                tent1.TheColor = TheColor;
                tent1.CfgID    = SoldierCfgIDs[i];
                tent1.MaxCount = TentsVolumes[i];
                tent1.Location = Location;
                tent1.Initialize();
                AddTent(tent1);
            }
        }
Пример #2
0
 public void AddTent(Tent tent)
 {
     if (GetTent(tent.ID) == null)
     {
         tent.GangID   = GangID;
         tent.TheColor = TheColor;
         tent.Location = Location;
         Tents.Add(tent);
     }
 }
Пример #3
0
        public void SelectTent(int index)
        {
            if (CurArmy != null && CurArmy.Tents.Count > index)
            {
                Tent tent = CurArmy.Tents[index];

                if (CurArmy.CurTent != tent)
                {
                    if (CurArmy.CurTent != null)
                    {
                        CurArmy.CurTent.OnLoseSelect();
                        UIsHolder.Instance.TentActionPanel.Show();
                    }

                    CurArmy.CurTent = tent;

                    CurArmy.CurTent.OnSelect();
                }

                //CurArmies.Clear();
                //CurArmies.Add(tent);
            }
        }