public override void Draw() { base.Draw(); float alpha; float quart = DematerializeDuration * 0.25f; if (DematerializingTicks < quart) { alpha = Mathf.InverseLerp(0, quart, DematerializingTicks); } else if (DematerializingTicks > quart * 3f) { alpha = Mathf.InverseLerp(DematerializeDuration, quart * 3f, DematerializingTicks); } else { alpha = 1f; } Graphics.DrawMesh(GraphicsLoader.replimatHopperGlow[dematerializingCycleInt].MeshAt(base.Rotation), this.DrawPos + new Vector3(0f, (int)AltitudeLayer.MoteOverhead * Altitudes.AltInc, 0f), Quaternion.identity, FadedMaterialPool.FadedVersionOf(GraphicsLoader.replimatHopperGlow[dematerializingCycleInt].MatAt(base.Rotation, null), alpha), 0); }
public static void DrawTickRotating(Thing thing, Material mat, float x, float z, float size = 1f, float angle = 0f, float opacity = 1, Layer myLayer = Layer.over, bool debug = false) { Vector3 dotS = new Vector3(size, 1f, size); Matrix4x4 matrix = default(Matrix4x4); Vector3 dotPos = thing.TrueCenter(); dotPos.x += x; dotPos.z += z; dotPos.y += (float)myLayer; Material fadedMat = mat; if (opacity != 1) { fadedMat = FadedMaterialPool.FadedVersionOf(mat, opacity); } if (debug) { Log.Warning("Drawing - ang: " + angle + "; opa:" + opacity); } matrix.SetTRS(dotPos, Quaternion.AngleAxis(angle, Vector3.up), dotS); Graphics.DrawMesh(MeshPool.plane10, matrix, fadedMat, 0); }
public static void DrawPulse( Thing thing, Material mat, Mesh mesh, Layer myLayer = Layer.over, OpacityWay opacityWay = OpacityWay.no, bool debug = false) { float myOpacity = UpdateOpacity(thing, opacityWay, 1, debug); Material material = FadedMaterialPool.FadedVersionOf(mat, myOpacity); Vector3 gfxPos = thing.DrawPos; gfxPos.y += (float)myLayer; Vector3 dotS = new Vector3(1f, 1f, 1f); Matrix4x4 matrix = default(Matrix4x4); matrix.SetTRS(gfxPos, Quaternion.AngleAxis(0f, Vector3.up), dotS); Graphics.DrawMesh(mesh, matrix, material, 0); if (debug) { Log.Warning( thing.LabelShort + "; opa: " + myOpacity + "; pos: " + gfxPos + "; col: " + mat.color ); } }
public override void PostDraw() { Material iconMat = null; //Si temperature du device chaude if (this.powerComp.PowerOn && !this.parent.IsBrokenDown() && this.hotLevelInt != 0) { if (this.hotLevelInt == 1) { iconMat = Tex.matHotLevel1; } else if (this.hotLevelInt == 2) { iconMat = Tex.matHotLevel2; } else if (this.hotLevelInt == 3) { iconMat = Tex.matHotLevel3; } Vector3 vector = this.parent.TrueCenter(); vector.y = Altitudes.AltitudeFor(AltitudeLayer.MetaOverlays) + 0.28125f; vector.x += this.parent.def.size.x / 4; vector.z -= 1; var num = (Time.realtimeSinceStartup + 397f * (float)(this.parent.thingIDNumber % 571)) * 4f; var num2 = ((float)Math.Sin((double)num) + 1f) * 0.5f; num2 = 0.3f + num2 * 0.7f; var material = FadedMaterialPool.FadedVersionOf(iconMat, num2); Graphics.DrawMesh(MeshPool.plane05, vector, Quaternion.identity, material, 0); } }
public override void PostDraw() { base.PostDraw(); if (!this.parent.IsBrokenDown()) { if (this.flickableComp != null && !this.flickableComp.SwitchIsOn) { this.parent.Map.overlayDrawer.DrawOverlay(this.parent, OverlayTypes.PowerOff); } else if (FlickUtility.WantsToBeOn(this.parent)) { if (!this.PowerOn) { /* Vector3 drawPos = parent.DrawPos; * * drawPos.y = BaseAlt + 0.181818187f; * Graphics.DrawMesh(MeshPool.plane05, drawPos, Quaternion.identity, OutOfGas, 0);*/ Vector3 drawPos = parent.DrawPos; drawPos.y = BaseAlt + 0.181818187f; float num = ((float)Math.Sin((double)((Time.realtimeSinceStartup + 397f * (float)(parent.thingIDNumber % 571)) * 4f)) + 1f) * 0.5f; num = 0.3f + num * 0.7f; Material material = FadedMaterialPool.FadedVersionOf(OutOfGas, num); Graphics.DrawMesh(MeshPool.plane08, drawPos, Quaternion.identity, material, 0); //this.parent.Map.overlayDrawer.DrawOverlay(this.parent, OverlayTypes.NeedsPower); } } } }
public void DrawDropSpotShadow(Vector3 center, float rot, Material material, Vector2 shadowSize, int ticksToImpact, bool flip) { if (base.Rotation.IsHorizontal) { Gen.Swap <float>(ref shadowSize.x, ref shadowSize.y); } ticksToImpact = Mathf.Max(ticksToImpact, 0); Vector3 pos = center; pos.y = AltitudeLayer.Shadows.AltitudeFor(); // float num = 1f + (float)ticksToImpact / 100f; float f = !this.def.skyfaller.zPositionCurve.EnumerableNullOrEmpty() ? this.def.skyfaller.zPositionCurve.Evaluate(this.TimeInAnimation) : this.TimeInAnimation; float num = 1f + Mathf.Max(0.25f, f) / 100f; // shadow = 1f * (float)ticksToImpact / 100f; Vector3 s = new Vector3(num * shadowSize.x, 1f, num * shadowSize.y); Color white = Color.white; if (ticksToImpact > 150) { white.a = Mathf.InverseLerp(200f, 150f, (float)ticksToImpact); } DropShipIncoming.shadowPropertyBlock.SetColor(ShaderPropertyIDs.Color, white); this.shadowMatrix.SetTRS(this.ShadowDrawPos + Altitudes.AltIncVect, (-rot).ToQuat(), s); Graphics.DrawMesh(MeshPool.plane10, this.shadowMatrix, FadedMaterialPool.FadedVersionOf(material, 0.4f * GenCelestial.CurShadowStrength(base.Map)), 0, null, 0); /* * matrix.SetTRS(pos, rot.AsQuat, s); * Graphics.DrawMesh(MeshPool.plane10Back, matrix, material, 0, null, 0, DropShipLeaving.shadowPropertyBlock); */ }
// Token: 0x0600012B RID: 299 RVA: 0x0000AA80 File Offset: 0x00008C80 public override void Draw() { this.spaceshipMatrix.SetTRS(this.DrawPos + Altitudes.AltIncVect, this.spaceshipExactRotation.ToQuat(), this.spaceshipScale); Graphics.DrawMesh(MeshPool.plane10, this.spaceshipMatrix, this.spaceshipTexture, 0); this.spaceshipShadowMatrix.SetTRS(this.ShadowDrawPos + Altitudes.AltIncVect, this.spaceshipExactRotation.ToQuat(), this.spaceshipShadowScale); Graphics.DrawMesh(MeshPool.plane10, this.spaceshipShadowMatrix, FadedMaterialPool.FadedVersionOf(this.spaceshipShadowTexture, 0.75f * GenCelestial.CurShadowStrength(base.Map)), 0); }
public override void Draw() { base.Draw(); if (ReplicatingTicks > 0) { float alpha; float quart = CollectDuration * 0.25f; if (ReplicatingTicks < quart) { alpha = Mathf.InverseLerp(0, quart, ReplicatingTicks); } else if (ReplicatingTicks > quart * 3f) { alpha = Mathf.InverseLerp(CollectDuration, quart * 3f, ReplicatingTicks); } else { alpha = 1f; } Graphics.DrawMesh(GraphicsLoader.replimatTerminalGlow.MeshAt(base.Rotation), this.DrawPos + Altitudes.AltIncVect, Quaternion.identity, FadedMaterialPool.FadedVersionOf(GraphicsLoader.replimatTerminalGlow.MatAt(base.Rotation, null), alpha), 0); } }
public new void DrawDropSpotShadow(Vector3 center, Rot4 rot, Material material, Vector2 shadowSize, int ticksToImpact) { if (rot.IsHorizontal) { Gen.Swap <float>(ref shadowSize.x, ref shadowSize.y); } ticksToImpact = Mathf.Max(ticksToImpact, 0); Vector3 pos = center; pos.y = AltitudeLayer.Shadows.AltitudeFor(); float num = 1f + (float)ticksToImpact / 100f; Vector3 s = new Vector3(num * shadowSize.x, 1f, num * shadowSize.y); Color white = Color.white; if (ticksToImpact > 150) { white.a = Mathf.InverseLerp(200f, 150f, (float)ticksToImpact); } DropShipLeaving.shadowPropertyBlock.SetColor(ShaderPropertyIDs.Color, white); this.shadowMatrix.SetTRS(this.ShadowDrawPos + Altitudes.AltIncVect, this.angle.ToQuat(), this.shadowScale); Graphics.DrawMesh(MeshPool.plane10, this.shadowMatrix, FadedMaterialPool.FadedVersionOf(this.ShadowMaterial, 0.4f * GenCelestial.CurShadowStrength(base.Map)), 0); Matrix4x4 matrix = default(Matrix4x4); /* * matrix.SetTRS(pos, rot.AsQuat, s); * Graphics.DrawMesh(MeshPool.plane10Back, matrix, material, 0, null, 0, DropShipLeaving.shadowPropertyBlock); */ }
public override void Draw() { SetupDrawing(); float opacity = Opacity; Graphics.DrawMesh(mesh, drawingMatrix, FadedMaterialPool.FadedVersionOf(materialBeam, opacity), 0); }
public void DrawMe(Vector3 location) { this.doTransitionStep(); Matrix4x4 matrix = new Matrix4x4(); matrix.SetTRS(location + Altitudes.AltIncVect, Quaternion.Euler(0.0f, this.currentAngle, 0.0f), Vector3.one); Graphics.DrawMesh(MeshPool.plane20, matrix, FadedMaterialPool.FadedVersionOf(ShieldBlendingParticle.ShieldSparksMat, (float)(0.200000002980232 + (double)this.transitionStatus / 80.0 * 0.699999988079071)), 0); }
public void DrawMe(Vector3 location) { this.doTransitionStep(); Matrix4x4 matrix4x4 = (Matrix4x4)null; // ISSUE: explicit reference operation ((Matrix4x4)@matrix4x4).SetTRS(Vector3.op_Addition(location, (Vector3)Altitudes.AltIncVect), Quaternion.Euler(0.0f, this.currentAngle, 0.0f), Vector3.get_one()); Graphics.DrawMesh((Mesh)MeshPool.plane20, matrix4x4, FadedMaterialPool.FadedVersionOf(ShieldBlendingParticle.ShieldSparksMat, (float)(0.200000002980232 + (double)this.transitionStatus / 80.0 * 0.699999988079071)), 0); }
private static void RenderPulsingOverlayQuest(Thing thing, Material mat, Vector3 drawPos, Mesh mesh) { float num = ((float)Math.Sin((double)((Time.realtimeSinceStartup + 397f * (float)(thing.thingIDNumber % 571)) * 4f)) + 1f) * 0.5f; num = 0.3f + num * 0.7f; Material material = FadedMaterialPool.FadedVersionOf(mat, num); Graphics.DrawMesh(mesh, drawPos, Quaternion.identity, material, 0); }
public void DrawMe(Vector3 location) { doTransitionStep(); Matrix4x4 matrix = default(Matrix4x4); matrix.SetTRS(location + Altitudes.AltIncVect, Quaternion.Euler(0f, currentAngle, 0f), UnityEngine.Vector3.one); UnityEngine.Graphics.DrawMesh(MeshPool.plane20, matrix, FadedMaterialPool.FadedVersionOf(ShieldBlendingParticle.ShieldSparksMat, 0.2f + (transitionStatus / (float)transitionMax) * 0.7f), 0); }
public override void Draw() { if (this.tickCounter == 0) { // Avoid drawing laser ray before it is initialized (this can happen when Draw is called before Tick). return; } Log.Message("this.tickCounter = " + this.tickCounter + ", this.drawingScale = " + this.drawingScale + ", this.drawingPosition = " + this.drawingPosition); Graphics.DrawMesh(MeshPool.plane10, this.drawingMatrix, FadedMaterialPool.FadedVersionOf(this.projectileDef.DrawMatSingle, this.drawingIntensity), 0); }
private static void RenderPulsingOverlayQuest(Thing thing, Material mat, Vector3 drawPos, Mesh mesh) { var num = (Time.realtimeSinceStartup + (397f * (thing.thingIDNumber % 571))) * 4f; var num2 = ((float)Math.Sin(num) + 1f) * 0.5f; num2 = 0.3f + (num2 * 0.7f); var material = FadedMaterialPool.FadedVersionOf(mat, num2); Graphics.DrawMesh(mesh, drawPos, Quaternion.identity, material, 0); }
// Meat grinder public static void PulseWarning(Thing thing, Material mat) { Material material = FadedMaterialPool.FadedVersionOf(mat, VanillaPulse(thing)); Vector3 dotS = new Vector3(.6f, 1f, .6f); Matrix4x4 matrix = default(Matrix4x4); Mesh mesh = MeshPool.plane14; matrix.SetTRS(thing.DrawPos, Quaternion.AngleAxis(0f, Vector3.up), dotS); Graphics.DrawMesh(mesh, matrix, material, 0); }
private void RenderPulsingOverlayInternal(Thing thing, Material mat, Vector3 drawPos, Mesh mesh) { float num = (float)((Time.realtimeSinceStartup + 397.0 * (float)(thing.thingIDNumber % 571)) * 4.0); float num2 = (float)(((float)Math.Sin((double)num) + 1.0) * 0.5); num2 = (float)(0.30000001192092896 + num2 * 0.699999988079071); Material material = FadedMaterialPool.FadedVersionOf(mat, num2); Graphics.DrawMesh(mesh, drawPos, Quaternion.identity, material, 0); }
public override void DrawWorker(Vector3 loc, Rot4 rot, ThingDef thingDef, Thing thing, float extraRotation) { Material workMaterial = null; if (MoteMaterialRefference.ContainsKey(thing)) { workMaterial = MoteMaterialRefference[thing]; } else { workMaterial = this.MatSingle; MoteMaterialRefference.Add(thing, workMaterial); // Do some cleanup for destroyed motes List <Thing> keys = new List <Thing>(MoteMaterialRefference.Keys.InRandomOrder()); //for (int i = keys.Count - 1; i >=0; i--) for (int i = 0; i < keys.Count; i++) { if (keys[i].Destroyed) { MoteMaterialRefference.Remove(keys[i]); } } } Mote mote = (Mote)thing; ThingDef def = mote.def; float ageSecs = mote.AgeSecs; Material material = workMaterial; float num = 1f; if (def.mote.fadeInTime != 0f && ageSecs <= def.mote.fadeInTime) { num = ageSecs / def.mote.fadeInTime; material = FadedMaterialPool.FadedVersionOf(workMaterial, num); } else if (ageSecs < def.mote.fadeInTime + def.mote.solidTime) { num = 1f; material = workMaterial; } else if (def.mote.fadeOutTime != 0f) { num = 1f - (ageSecs - def.mote.fadeInTime - def.mote.solidTime) / def.mote.fadeOutTime; material = FadedMaterialPool.FadedVersionOf(workMaterial, num); } if (num <= 0f) { return; } Matrix4x4 matrix = default(Matrix4x4); matrix.SetTRS(mote.DrawPos, Quaternion.AngleAxis(mote.exactRotation, Vector3.up), mote.exactScale); Graphics.DrawMesh(MeshPool.plane10, matrix, material, 0); }
// Token: 0x06000009 RID: 9 RVA: 0x000021F8 File Offset: 0x000003F8 public static void RenderPulsingNeedsPowerOverlay(IntVec3 loc) { var vector = loc.ToVector3ShiftedWithAltitude(AltitudeLayer.MapDataOverlay); var num = (Time.realtimeSinceStartup + (397f * loc.HashCodeToMod(37))) * 4f; var num2 = ((float)Math.Sin(num) + 1f) * 0.5f; num2 = 0.3f + (num2 * 0.7f); var material = FadedMaterialPool.FadedVersionOf(NeedsPowerMat, num2); Graphics.DrawMesh(MeshPool.plane08, vector, Quaternion.identity, material, 0); }
// Token: 0x06000009 RID: 9 RVA: 0x000021F8 File Offset: 0x000003F8 public static void RenderPulsingNeedsPowerOverlay(IntVec3 loc) { Vector3 vector = loc.ToVector3ShiftedWithAltitude(AltitudeLayer.MapDataOverlay); float num = (Time.realtimeSinceStartup + 397f * (float)loc.HashCodeToMod(37)) * 4f; float num2 = ((float)Math.Sin((double)num) + 1f) * 0.5f; num2 = 0.3f + num2 * 0.7f; Material material = FadedMaterialPool.FadedVersionOf(ActiveTerrainUtility.NeedsPowerMat, num2); Graphics.DrawMesh(MeshPool.plane08, vector, Quaternion.identity, material, 0); }
public override void Draw() { SetupDrawing(); float opacity = Opacity; if (Lightning) { Vector3 vector; vector.x = (float)b.x; vector.y = (float)b.y; vector.z = (float)b.z; float distance = Vector3.Distance(a, b); for (int i = 0; i < def.ArcCount; i++) { if (this.def.graphicData.graphicClass == typeof(Graphic_Flicker)) { if (!Find.TickManager.Paused && Find.TickManager.TicksGame % this.def.flickerFrameTime == 0) { materialBeam = def.GetBeamMaterial((this.def.materials.IndexOf(materialBeam) + 1 < this.def.materials.Count ? this.def.materials.IndexOf(materialBeam) + 1 : 0)) ?? def.graphicData.Graphic.MatSingle; } } meshes[i] = Find.TickManager.Paused || meshes[i] != null && Static ? meshes[i] : LightningBoltMeshMakerOG.NewBoltMesh(new Vector2(0, -(distance + 0.25f))); Graphics.DrawMesh(this.meshes[i], b, Quaternion.LookRotation((vector - this.a).normalized), FadedMaterialPool.FadedVersionOf(materialBeam, opacity), 0); } /* * mesh = Find.TickManager.Paused || mesh != null && Static ? mesh : LightningBoltMeshMakerOG.NewBoltMesh(new Vector2(0, -(distance + 0.25f))); * Graphics.DrawMesh(this.mesh, b, Quaternion.LookRotation((vector - this.a).normalized), FadedMaterialPool.FadedVersionOf(materialBeam, opacity), 0); * if (meshb != null && def.ArcCount > 1) * { * meshb = Find.TickManager.Paused || meshb != null && Static ? meshb : LightningBoltMeshMakerOG.NewBoltMesh(new Vector2(0, -(distance + 0.25f))); * Graphics.DrawMesh(this.meshb, b, Quaternion.LookRotation((vector - this.a).normalized), FadedMaterialPool.FadedVersionOf(materialBeam, opacity), 0); * } * if (meshc != null && def.ArcCount > 2) * { * meshc = Find.TickManager.Paused || meshc != null && Static ? meshc : LightningBoltMeshMakerOG.NewBoltMesh(new Vector2(0, -(distance + 0.25f))); * Graphics.DrawMesh(this.meshc, b, Quaternion.LookRotation((vector - this.a).normalized), FadedMaterialPool.FadedVersionOf(materialBeam, opacity), 0); * } */ } else { if (this.def.graphicData.graphicClass == typeof(Graphic_Flicker)) { if (!Find.TickManager.Paused && Find.TickManager.TicksGame % this.def.flickerFrameTime == 0) { materialBeam = def.GetBeamMaterial((this.def.materials.IndexOf(materialBeam) + 1 < this.def.materials.Count ? this.def.materials.IndexOf(materialBeam) + 1 : 0)) ?? def.graphicData.Graphic.MatSingle; } } Graphics.DrawMesh(mesh, drawingMatrix, FadedMaterialPool.FadedVersionOf(materialBeam, opacity), 0); } }
public override void WeatherEventDraw() { if (this.meshStart != default(Vector3)) { Graphics.DrawMesh(this.boltMesh, this.meshStart, Quaternion.Euler(0f, this.angle, 0f), FadedMaterialPool.FadedVersionOf(this.meshMat, this.MeshBrightness), 0); } else { Graphics.DrawMesh(this.boltMesh, this.meshEnd, Quaternion.identity, FadedMaterialPool.FadedVersionOf(this.meshMat, this.MeshBrightness), 0); } }
public override void Draw() { if (boltMesh != null) { Graphics.DrawMesh(boltMesh, strikeLoc.ToVector3ShiftedWithAltitude(AltitudeLayer.Weather), Quaternion.identity, FadedMaterialPool.FadedVersionOf( WeatherEvent_LightningStrike_LightningMat(), LightningBrightness), 0); } //base.Comps_PostDraw(); }
// Token: 0x06000766 RID: 1894 RVA: 0x00067580 File Offset: 0x00065780 public void CreateFadedBolt(int magnitude) { Vector3 vector; vector.x = (float)this.hitThing.x; vector.y = (float)this.hitThing.y; vector.z = (float)this.hitThing.z; this.direction = Quaternion.LookRotation((vector - this.origin).normalized); float distance = Vector3.Distance(this.origin, vector); this.boltMesh = AdeptusMeshMaker.NewBoltMesh(distance, 6f); Graphics.DrawMesh(this.boltMesh, this.origin, this.direction, FadedMaterialPool.FadedVersionOf(this.mat, (float)magnitude), 0); }
// Token: 0x06000100 RID: 256 RVA: 0x00009A08 File Offset: 0x00007C08 public override void Draw() { base.Comps_PostDraw(); bool flag = !GenList.NullOrEmpty <Matrix4x4>(this.drawingMatrix); if (flag) { foreach (Matrix4x4 matrix in this.drawingMatrix) { Graphics.DrawMesh(MeshPool.plane10, matrix, FadedMaterialPool.FadedVersionOf(this.drawingTexture, this.drawingIntensity), 0); } } }
public override void Tick() { base.Tick(); age++; if (!Expired) { Graphics.DrawMesh(this.boltMesh, StrikeLoc.ToVector3ShiftedWithAltitude(AltitudeLayer.Weather), Quaternion.identity, FadedMaterialPool.FadedVersionOf(LightningMat, LightningBrightness), 0); } }
public override void PostDraw() { base.PostDraw(); if (!this.HasFuel) { Vector3 drawPos = parent.DrawPos; drawPos.y = BaseAlt + 0.181818187f; float num = ((float)Math.Sin((double)((Time.realtimeSinceStartup + 397f * (float)(parent.thingIDNumber % 571)) * 4f)) + 1f) * 0.5f; num = 0.3f + num * 0.7f; Material material = FadedMaterialPool.FadedVersionOf(OutOfLightning, num); Graphics.DrawMesh(MeshPool.plane08, drawPos, Quaternion.identity, material, 0); // this.parent.Map.overlayDrawer.DrawOverlay(this.parent, OverlayTypes.OutOfFuel); } }
public void DrawColorPulse(Thing thing, Material mat, Vector3 drawPos, Mesh mesh, Color color) { float myOpacity = PulseOpacity(thing); Material material = FadedMaterialPool.FadedVersionOf(mat, myOpacity); ChangeColor(mat, color, myOpacity); Vector3 dotS = new Vector3(1f, 1f, 1f); Matrix4x4 matrix = default(Matrix4x4); matrix.SetTRS(drawPos, Quaternion.AngleAxis(0f, Vector3.up), dotS); Graphics.DrawMesh(mesh, matrix, material, 0); }
public override void Draw() { SetupDrawing(); float opacity = Opacity; if (this.def.graphicData.graphicClass == typeof(Graphic_Flicker)) { if (!Find.TickManager.Paused && Find.TickManager.TicksGame % this.def.flickerFrameTime == 0) { materialBeam = def.GetBeamMaterial(Rand.RangeInclusive(0, this.def.materials.Count)) ?? def.graphicData.Graphic.MatSingle; } } Graphics.DrawMesh(mesh, drawingMatrix, FadedMaterialPool.FadedVersionOf(materialBeam, opacity), 0); }