15 return ELayer.player.hoard;
20 public override void OnAfterInit()
22 ELayer.sources.collectibles.Init();
23 Msg.TalkHomeMemeber(
"layerHoard");
25 this.actor = Util.Instantiate<
HoardActor>(this.actor,
null);
26 if (this.hoard.items.Count == 0)
34 base.InvokeRepeating(
"UpdateMousePos", 0f, 0.1f);
35 if (!
ELayer.debug.debugHoard)
37 UIButton[] array = this.debugButtons;
38 for (
int i = 0; i < array.Length; i++)
40 array[i].SetActive(
false);
43 this.layoutMenu.RebuildLayout(
true);
44 SoundManager.disableSpread =
true;
45 ELayer.Sound.zone.enabled =
false;
46 ELayer.scene.cam.enabled =
false;
52 this.actor.Activate();
53 this.textMode.text =
"[" + (
"h_" + this.hoard.mode.ToString()).lang() +
"]";
57 public override void OnKill()
60 UnityEngine.Object.DestroyImmediate(this.actor.gameObject);
62 ELayer.ui.cg.alpha = 1f;
63 ELayer.Sound.maxSounds =
ELayer.Sound._maxSounds;
64 SoundManager.disableSpread =
false;
65 ELayer.Sound.zone.enabled =
true;
66 ELayer.scene.cam.enabled =
true;
72 if (this.textScore.gameObject.activeSelf &&
this.hoard.score !=
this.lastScore)
74 this.textScore.text = this.hoard.score.ToString() +
" / " + this.hoard.hiScore.ToString();
75 this.lastScore = this.hoard.score;
77 if (Input.GetMouseButtonDown(2))
83 if (Input.GetKeyDown(KeyCode.H))
85 this.hoard.hentai =
true;
86 this.hoard.Add(
"lulu", 2,
false);
87 this.hoard.Add(
"tentacle", 1,
false);
88 this.hoard.Add(
"tentacle2", 1,
false);
89 this.hoard.Add(
"tentacle3", 1,
false);
90 this.hoard.Add(
"tentacle4", 2,
false);
91 Msg.SayPic(
"UN_farris",
"変態だー!",
null);
94 if (Input.GetKeyDown(KeyCode.M))
99 if (collectibleActor && collectibleActor.gameObject.activeInHierarchy)
101 Msg.Nerun(
"あ・・・",
"UN_nerun");
103 rigidExplode.particle = this.actor.psExplode;
104 rigidExplode.radius *= 10f;
105 rigidExplode.force *= 10f;
106 rigidExplode.chance = 1f;
107 rigidExplode.intervalMin = (rigidExplode.intervalMax = 2f);
108 rigidExplode.rb = collectibleActor.GetComponent<Rigidbody2D>();
109 this.actor.updates.Add(rigidExplode);
117 UIButton componentOf = InputModuleEX.GetComponentOf<UIButton>();
118 if (
ELayer.ui.GetTopLayer() !=
this || (componentOf && componentOf.transform.IsChildOf(base.transform)) ||
this.hasMouseMoved)
125 this.idleTimer += Time.deltaTime;
126 if (this.idleTimer > 1f)
131 (this.cg ??
ELayer.ui.cg).alpha += (
float)this.v * Time.deltaTime * this.fadeSpeed;
132 ELayer.Sound.maxSounds = this.hoard.maxSounds;
136 private void UpdateMousePos()
138 this.hasMouseMoved = ((Input.mousePosition - this.lastMousePos).magnitude > 15f);
139 this.lastMousePos = Input.mousePosition;
143 public void AddRandom()
147 if (!row.tag.Contains(
"noSpawn"))
149 int num = (row.num == 0) ? 10 : row.num;
157 public void Generate()
162 if (!row.tag.Contains(
"noSpawn"))
164 this.hoard.Add(row.id);
167 this.hoard.mode =
Hoard.Mode.lux;
172 public void OnClickClear()
175 this.hoard.Add(
"gold", 1,
false);
180 public void OnClickNextMode()
182 this.hoard.mode = this.hoard.mode.NextEnum<
Hoard.Mode>();
183 Msg.Nerun(
"h_filter".lang((
"h_" + this.hoard.mode.ToString()).lang(),
null,
null,
null,
null),
"UN_nerun");
188 public void OnClickConfig()
190 UIContextMenu uicontextMenu =
ELayer.ui.contextMenu.Create(
"ContextHoard",
true);
191 int max = this.actor.bgs.Length - 1;
192 uicontextMenu.AddSlider(
"room", (
float n) => n.ToString() +
" / " + max.ToString(), (
float)
this.hoard.bg, delegate(
float v)
194 this.hoard.bg = (int)v;
195 this.actor.RefreshBG();
196 }, 0f, (float)max,
true,
false,
false);
197 uicontextMenu.AddSlider(
"reflection", (
float n) => n.ToString() +
" %", (
float)
this.hoard.reflection, delegate(
float v)
199 this.hoard.reflection = (int)v;
200 this.actor.RefreshBG();
201 }, 0f, 300f,
true,
false,
false);
202 uicontextMenu.AddSlider(
"maxSounds", (
float n) => n.ToString() ??
"", (
float)
this.hoard.maxSounds, delegate(
float v)
204 this.hoard.maxSounds = (int)v;
205 }, 0f, 64f,
true,
false,
false);
206 uicontextMenu.AddSlider(
"volume", (
float n) => n.ToString() ??
"", (
float)
this.hoard.volume, delegate(
float v)
208 this.hoard.volume = (int)v;
209 }, 0f, 200f,
true,
false,
false);
210 uicontextMenu.AddToggle(
"voice", this.hoard.voice, delegate(
bool on)
212 this.hoard.voice = on;
214 uicontextMenu.AddToggle(
"shadow", this.hoard.shadow, delegate(
bool on)
216 this.hoard.shadow = on;
218 uicontextMenu.AddToggle(
"pixelPerfect", this.hoard.pixelPerfect, delegate(
bool on)
220 this.hoard.pixelPerfect = on;
221 this.actor.RefreshZoom();
223 uicontextMenu.Show();
230 public bool autoList;
236 public float idleTimer;
239 public float fadeSpeed;
242 public CanvasGroup cg;
245 public UIText textMode;
248 public UIText textScore;
251 public UIText textTime;
254 public UIButton[] debugButtons;
257 public LayoutGroup layoutMenu;
260 private int lastScore;
266 private Vector3 lastMousePos;
269 private bool hasMouseMoved;