コード例 #1
0
        public void DrawGraffiti(CreateGraffitiEvent e, GraffitiSimpleNode graffitiNode, [JoinByUser] RemoteUserNode user, [JoinByUser] TankWithGraffitiNode tank, [JoinByUser] Optional <SingleNode <PremiumAccountBoostComponent> > premium, [JoinAll] SingleNode <DecalManagerComponent> decalManagerNode, [JoinAll] SingleNode <BurningTargetBloomComponent> bloomPostEffect)
        {
            GameObject obj2 = this.DrawGraffiti(decalManagerNode.component, graffitiNode.dynamicDecalProjector, e.Position, e.Direction, e.Up);

            if (obj2)
            {
                graffitiNode.graffitiInstance.GraffitiDecalObject = obj2;
                this.PlaySound(graffitiNode.graffitiSound.Sound, e.Position);
                this.AddEmitEffect(graffitiNode, bloomPostEffect.component);
                if (premium.IsPresent())
                {
                    GraffitiVisualEffectComponent graffitiVisualEffect = tank.graffitiVisualEffect;
                    GraffitiVisualEffect          visualEffectPrefab   = graffitiVisualEffect.VisualEffectPrefab;
                    this.DrawEffect(visualEffectPrefab, graffitiVisualEffect.TimeToDestroy, tank.tankCommonInstance.TankCommonInstance.transform, graffitiNode.imageItem.SpriteUid, graffitiNode.itemRarity.RarityType);
                }
            }
        }
コード例 #2
0
        private void DrawEffect(GraffitiVisualEffect prefab, float length, Transform parent, string spriteUid, ItemRarityType rarity)
        {
            GetInstanceFromPoolEvent eventInstance = new GetInstanceFromPoolEvent {
                Prefab          = prefab.gameObject,
                AutoRecycleTime = length
            };

            base.ScheduleEvent(eventInstance, new EntityStub());
            Transform instance = eventInstance.Instance;

            instance.parent        = parent;
            instance.localPosition = Vector3.zero;
            instance.localRotation = Quaternion.identity;
            GraffitiVisualEffect component = instance.GetComponent <GraffitiVisualEffect>();

            component.Image.SpriteUid = spriteUid;
            component.Rarity          = rarity;
            component.gameObject.SetActive(true);
        }
コード例 #3
0
        public void DrawGraffiti(CreateGraffitiEvent e, FirstGraffitiNode graffitiNode, [JoinByUser] SingleNode <SelfBattleUserComponent> self, [JoinByUser] TankWithGraffitiNode tank, [JoinByUser] Optional <SingleNode <PremiumAccountBoostComponent> > premium, [JoinAll] SingleNode <DecalManagerComponent> decalManagerNode, [JoinAll] SingleNode <BurningTargetBloomComponent> bloomPostEffect)
        {
            GameObject obj2 = this.DrawGraffiti(decalManagerNode.component, graffitiNode.dynamicDecalProjector, e.Position, e.Direction, e.Up);

            if (obj2)
            {
                graffitiNode.graffitiInstance.GraffitiDecalObject = obj2;
                graffitiNode.Entity.AddComponent(new GraffitiDecalComponent(e.Position, e.Direction, e.Up));
                this.PlaySound(graffitiNode.graffitiSound.Sound, e.Position);
                if (graffitiNode.dynamicDecalProjector.Emmit)
                {
                    Renderer component = graffitiNode.graffitiInstance.GraffitiDecalObject.GetComponent <Renderer>();
                    graffitiNode.graffitiInstance.EmitRenderer = component;
                    bloomPostEffect.component.burningTargetBloom.targets.Add(component);
                }
                if (premium.IsPresent())
                {
                    GraffitiVisualEffectComponent graffitiVisualEffect = tank.graffitiVisualEffect;
                    GraffitiVisualEffect          visualEffectPrefab   = graffitiVisualEffect.VisualEffectPrefab;
                    this.DrawEffect(visualEffectPrefab, graffitiVisualEffect.TimeToDestroy, tank.tankCommonInstance.TankCommonInstance.transform, graffitiNode.imageItem.SpriteUid, graffitiNode.itemRarity.RarityType);
                }
            }
        }