예제 #1
0
        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();
                }
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
 public void SetDataProvider(object dataProvider)
 {
     if (!ReferenceEquals(this.entity, dataProvider))
     {
         this.entity = (Platform.Kernel.ECS.ClientEntitySystem.API.Entity)dataProvider;
         this.FillFromEntity(this.entity);
     }
 }
예제 #4
0
 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));
 }
예제 #5
0
 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];
         }
     }
 }
예제 #6
0
        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;
        }
예제 #7
0
 protected virtual void FillFromEntity(Platform.Kernel.ECS.ClientEntitySystem.API.Entity entity)
 {
 }
예제 #8
0
 public HandlerBroadcastInvokeData(Handler handler, Platform.Kernel.ECS.ClientEntitySystem.API.Entity entity) : base(handler)
 {
     this.entity = entity;
 }
예제 #9
0
 public EntityCommand(Platform.Kernel.ECS.ClientEntitySystem.API.Entity entity)
 {
     this.Entity = (EntityInternal)entity;
 }
예제 #10
0
 public void AttachedToEntity(Platform.Kernel.ECS.ClientEntitySystem.API.Entity entity)
 {
     this.Entity = entity;
 }
예제 #11
0
        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);
        }
예제 #12
0
 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);
 }
예제 #13
0
 public HealingGraphicEffectInputs(Platform.Kernel.ECS.ClientEntitySystem.API.Entity entity, SkinnedMeshRenderer renderer)
 {
     this.entity   = entity;
     this.renderer = renderer;
 }