From e9ea621b93fbb58d9edfca8375918791637bbd52 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 30 Dec 2020 20:59:04 +0800 Subject: +init --- Client/Assembly-CSharp/MapConsole.cs | 65 ++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Client/Assembly-CSharp/MapConsole.cs (limited to 'Client/Assembly-CSharp/MapConsole.cs') diff --git a/Client/Assembly-CSharp/MapConsole.cs b/Client/Assembly-CSharp/MapConsole.cs new file mode 100644 index 0000000..84a2e68 --- /dev/null +++ b/Client/Assembly-CSharp/MapConsole.cs @@ -0,0 +1,65 @@ +using System; +using UnityEngine; + +public class MapConsole : MonoBehaviour, IUsable +{ + public float UsableDistance + { + get + { + return this.usableDistance; + } + } + + public float PercentCool + { + get + { + return 0f; + } + } + + public float usableDistance = 1f; + + public SpriteRenderer Image; + + public void SetOutline(bool on, bool mainTarget) + { + if (this.Image) + { + this.Image.material.SetFloat("_Outline", (float)(on ? 1 : 0)); + this.Image.material.SetColor("_OutlineColor", Color.white); + this.Image.material.SetColor("_AddColor", mainTarget ? Color.white : Color.clear); + } + } + + public float CanUse(GameData.PlayerInfo pc, out bool canUse, out bool couldUse) + { + float num = float.MaxValue; + PlayerControl @object = pc.Object; + couldUse = pc.Object.CanMove; + canUse = couldUse; + if (canUse) + { + num = Vector2.Distance(@object.GetTruePosition(), base.transform.position); + canUse &= (num <= this.UsableDistance); + } + return num; + } + + public void Use() + { + bool flag; + bool flag2; + this.CanUse(PlayerControl.LocalPlayer.Data, out flag, out flag2); + if (!flag) + { + return; + } + PlayerControl.LocalPlayer.NetTransform.Halt(); + DestroyableSingleton.Instance.ShowMap(delegate(MapBehaviour m) + { + m.ShowCountOverlay(); + }); + } +} -- cgit v1.1-26-g67d0