Пример #1
0
        public override void Draw()
        {
            float arcHeightFactor  = def.projectile.arcHeightFactor;
            float arcHeightFactor2 = (destination - origin).MagnitudeHorizontalSquared();

            if (arcHeightFactor * arcHeightFactor > arcHeightFactor2 * 0.2f * 0.2f)
            {
                arcHeightFactor = Mathf.Sqrt(arcHeightFactor2) * 0.2f;
            }

            float   num      = arcHeightFactor * GenMath.InverseParabola(DistanceCoveredFraction);
            Vector3 drawPos  = DrawPos;
            Vector3 position = drawPos + new Vector3(0f, 0f, 1f) * num;

            //Graphics.DrawMesh(MeshPool.GridPlane(def.graphicData.drawSize), position, ExactRotation, def.DrawMatSingle, 0);

            Mesh       mesh = this.Graphic.MeshAt(this.Rotation);
            Quaternion quat = Quaternion.AngleAxis(this.curRotation, Vector3.up);

            Material mat = this.Graphic.MatAt(this.Rotation, this);

            Graphics.DrawMesh(mesh, position, quat, mat, 0);



            Comps_PostDraw();
        }
Пример #2
0
        public override void Draw()
        {
            float num = this.ArcHeightFactor * GenMath.InverseParabola(this.DistanceCoveredFraction);

            if (this.flyingThing != null)
            {
                if (this.flyingThing is Pawn)
                {
                    if (!this.DrawPos.ToIntVec3().IsValid)
                    {
                        return;
                    }
                    Pawn pawn = this.flyingThing as Pawn;
                    pawn.Drawer.DrawAt(this.DrawPos);
                }
                else
                {
                    Graphics.DrawMesh(MeshPool.plane10, this.DrawPos, this.ExactRotation, this.flyingThing.def.DrawMatSingle, 0);
                }
                if (this.def.projectile.shadowSize > 0f)
                {
                    this.DrawShadow(this.ExactPosition, num);
                }
            }
            else
            {
                Graphics.DrawMesh(MeshPool.plane10, this.DrawPos, this.ExactRotation, this.flyingThing.def.DrawMatSingle, 0);
            }
            drawGlow();
            base.Comps_PostDraw();
        }
Пример #3
0
        // Token: 0x06001651 RID: 5713 RVA: 0x00081EDC File Offset: 0x000800DC
        public override void Draw()
        {
            float   num     = this.ArcHeightFactor * GenMath.InverseParabola(this.DistanceCoveredFraction);
            Vector3 drawPos = this.DrawPos;

            Vector3 position = drawPos + new Vector3(0f, 0f, 1f) * num;

            if (this.ticksToImpact > 0 && !Find.TickManager.Paused)
            {
                this.rotinc += rotrate;
            }
            if (this.def.projectile.shadowSize > 0f)
            {
                this.DrawShadow(drawPos, num);
            }
            Graphics.DrawMesh(MeshPool.GridPlane(this.def.graphicData.drawSize), position, this.ExactRotation, this.Graphic.MatSingleFor(this), 0);
            base.Comps_PostDraw();
        }
        public override void Draw()
        {
            float   num      = ArcHeightFactor * GenMath.InverseParabola(DistanceCoveredFraction);
            Vector3 drawPos  = DrawPos;
            Vector3 position = drawPos + new Vector3(0f, 0f, 1f) * num;

            if (def.projectile.shadowSize > 0f)
            {
                DrawShadow(drawPos, num);
            }
            if (onGround)
            {
                Graphics.DrawMesh(MeshPool.GridPlane(def.graphicData.drawSize), position, ExactRotation, groundMat, 0);
            }
            else
            {
                Graphics.DrawMesh(MeshPool.GridPlane(def.graphicData.drawSize), position, ExactRotation, def.DrawMatSingle, 0);
            }
            Comps_PostDraw();
        }
Пример #5
0
        public override void Tick()
        {
            float progress = (float)this.ticksFlying / (float)this.ticksFlightTime;

            this.position = Vector3.Lerp(this.startVec, this.target, progress) + new Vector3(0f, 0f, 2f) * GenMath.InverseParabola(progress);


            IList value = Traverse.Create(this.FlyingPawn.Drawer.renderer).Field("effecters").Field("pairs").GetValue() as IList;

            foreach (object o in value)
            {
                Traverse.Create(o).Field("effecter").GetValue <Effecter>().EffectTick(new TargetInfo(this.position.ToIntVec3(), this.Map), TargetInfo.Invalid);
            }

            base.Tick();
        }