private void JoinChildren <T>(Transform transform, Platform.Kernel.ECS.ClientEntitySystem.API.Entity key) where T : GroupComponent, new() { IEnumerator enumerator = transform.GetEnumerator(); try { while (enumerator.MoveNext()) { Transform current = (Transform)enumerator.Current; EntityBehaviour component = current.GetComponent <EntityBehaviour>(); if (component != null) { component.Join <T>(key); continue; } this.JoinChildren <T>(current, key); } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } }
private void DoCreateEntity(Engine engine) { long templateId = this.TemplateId; Platform.Kernel.ECS.ClientEntitySystem.API.Entity entity = (templateId == 0L) ? engine.CreateEntity(base.name) : engine.CreateEntity(templateId, this.configPath); this.BuildEntity(entity); }
public void SetDataProvider(object dataProvider) { if (!ReferenceEquals(this.entity, dataProvider)) { this.entity = (Platform.Kernel.ECS.ClientEntitySystem.API.Entity)dataProvider; this.FillFromEntity(this.entity); } }
public void BuildEntity(Platform.Kernel.ECS.ClientEntitySystem.API.Entity entity) { if (this.Entity != null) { throw new EntityAlreadyExistsException(this.Entity.Name); } this.Entity = entity; this.CollectComponents(base.gameObject, new Action <Component>(this.AddComponent)); }
public void Init(Platform.Kernel.ECS.ClientEntitySystem.API.Entity entity, List <string> images = null) { this.Entity = entity; if (images != null) { for (int i = 0; i < this.preview.Length; i++) { this.preview[i].SpriteUid = images[i]; } } }
public void UpdateData() { string text; if (!this.Entity.HasComponent <PaymentGiftComponent>()) { this.giftLabel.SetActive(false); } else { PaymentGiftComponent component = this.Entity.GetComponent <PaymentGiftComponent>(); Platform.Kernel.ECS.ClientEntitySystem.API.Entity marketItem = Flow.Current.EntityRegistry.GetEntity(component.Gift); this.giftPreview.SpriteUid = marketItem.GetComponent <ImageItemComponent>().SpriteUid; this.giftLabel.SetActive(true); this.giftPreview.GetComponent <TooltipShowBehaviour>().TipText = MarketItemNameLocalization.GetFullItemDescription(marketItem, (string)this._commonString, (string)this._rareString, (string)this._epicString, (string)this._legendaryString); } XCrystalsPackComponent component2 = this.Entity.GetComponent <XCrystalsPackComponent>(); SaleState saleState = this.Entity.GetComponent <GoodsComponent>().SaleState; string str = "<b> "; long amount = component2.Amount; long num2 = (long)Math.Round((double)(component2.Amount * saleState.AmountMultiplier)); long bonus = component2.Bonus; if (saleState.AmountMultiplier <= 1.0) { str = str + amount.ToStringSeparatedByThousands(); object[] objArray2 = new object[] { ((long)(amount + bonus)).ToStringSeparatedByThousands(), "<sprite=", this.xCrySpriteIndex, ">" }; this.totalAmount.text = string.Concat(objArray2); } else { str = str + num2.ToStringSeparatedByThousands() + $" <s><#{this.greyColor.Color.ToHexString()}>{amount.ToStringSeparatedByThousands()}</color></s>"; this.totalAmount.text = ((long)(num2 + bonus)).ToStringSeparatedByThousands(); this.totalAmount.text = this.totalAmount.text + $" <s><#{this.greyColor.Color.ToHexString()}>{((long) (amount + bonus)).ToStringSeparatedByThousands()}</color></s>"; text = this.totalAmount.text; object[] objArray1 = new object[] { text, "<sprite=", this.xCrySpriteIndex, ">" }; this.totalAmount.text = string.Concat(objArray1); } text = str; object[] objArray3 = new object[] { text, "</b><sprite=", this.xCrySpriteIndex, ">\n" }; str = string.Concat(objArray3); str = (bonus <= 0L) ? (str + "\n") : (str + string.Format("<size=17><#{2}>+{0} {1}<sprite=" + this.xCrySpriteIndex + "></color>", bonus.ToStringSeparatedByThousands(), this.forFree.Value, this.greyColor.Color.ToHexString())); this.amount.text = str; GoodsPriceComponent component4 = this.Entity.GetComponent <GoodsPriceComponent>(); str = component4.Round(this.Entity.GetComponent <GoodsComponent>().SaleState.PriceMultiplier *component4.Price).ToStringSeparatedByThousands(); if (saleState.PriceMultiplier < 1.0) { str = str + $" <s><#{this.greyColor.Color.ToHexString()}>{component4.Price.ToStringSeparatedByThousands()}</color></s>"; } str = str + " " + component4.Currency; this.price.text = str; }
protected virtual void FillFromEntity(Platform.Kernel.ECS.ClientEntitySystem.API.Entity entity) { }
public HandlerBroadcastInvokeData(Handler handler, Platform.Kernel.ECS.ClientEntitySystem.API.Entity entity) : base(handler) { this.entity = entity; }
public EntityCommand(Platform.Kernel.ECS.ClientEntitySystem.API.Entity entity) { this.Entity = (EntityInternal)entity; }
public void AttachedToEntity(Platform.Kernel.ECS.ClientEntitySystem.API.Entity entity) { this.Entity = entity; }
private void AddJoinComponent <T>(Platform.Kernel.ECS.ClientEntitySystem.API.Entity key) where T : GroupComponent { GroupComponent component = GroupRegistry.FindOrCreateGroup <T>(key.Id); this.Entity.AddComponent(component); }
public void Join <T>(Platform.Kernel.ECS.ClientEntitySystem.API.Entity key) where T : GroupComponent, new() { this.AddJoinComponent <T>(key); this.JoinChildren <T>(base.gameObject.transform, key); }
public HealingGraphicEffectInputs(Platform.Kernel.ECS.ClientEntitySystem.API.Entity entity, SkinnedMeshRenderer renderer) { this.entity = entity; this.renderer = renderer; }