// constructor public FlightControl() { this.speed = 1; this.timestep = 0; this.numLines = 0; this.isReverse = false; this.stop = true; this.pilot = new SimplePilot(); this.flightdata = new FlightData(); this.research = new Research(); this.paths = new PathInfo(); }
protected override void EntryAdded(GameObject entry, int tier, int entryIndex) { IResearch research = m_researchManager.AllResearch.FirstOrDefault(x => x.Tier == tier && x.Order == entryIndex); ResearchUserControl uc = entry.GetComponent <ResearchUserControl>(); uc.DataContext = research; uc.Name = research != null ? research.Name : "Empty"; uc.Description = research != null ? research.Description : "Non description"; uc.Cost = research != null ? research.Cost : 0.0; uc.Icon = GetResearchSprite(research?.Name); uc.AmountBought = research != null ? research.AmountBought : 0; uc.MaxAmountAllowed = research != null ? research.MaxAmountAllowed : 1; uc.OnBuyResearch += OnPurchaseResearch; }
/// <summary> /// 构造 /// </summary> /// <param name="_inResearch"></param> public InResearchController(IResearch _inResearch) { _IResearch = _inResearch; }
private void OnPurchaseResearch(IResearch research) { m_researchManager.BuyResearch(research); UpdateList(); }