|
|
|
@ -146,6 +146,7 @@ namespace ET
|
|
|
|
|
self.UpdateValleyTime = TimeHelper.ServerUnix(); |
|
|
|
|
self.SeasonConfig = SeasonConfigCategory.Instance.Get(self.Season); |
|
|
|
|
self.InitPeopleNumberic(); |
|
|
|
|
self.InitFarmlandDic(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void updateSeason(this Unit self) |
|
|
|
@ -245,6 +246,25 @@ namespace ET
|
|
|
|
|
((People) v).GrowUp(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void InitFarmlandDic(this Unit self) |
|
|
|
|
{ |
|
|
|
|
var bc = self.GetComponent<BuildingComponent>(); |
|
|
|
|
if (bc == null) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
foreach (var v in self.GetComponent<BuildingComponent>().Children.Values) |
|
|
|
|
{ |
|
|
|
|
foreach (var c in v.Children.Values) |
|
|
|
|
{ |
|
|
|
|
if (c.GetType() == typeof (Farmland)) |
|
|
|
|
{ |
|
|
|
|
self.FarmlandDic[c.Id] = (Farmland) c; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |