Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
MiniGame_Basket.cs
Go to the documentation of this file.
1using UnityEngine;
2
3public class MiniGame_Basket : ModMinigame<Shooter>
4{
5 public Shooter prefab;
6
7 public override string id => "Basket";
8
9 public override void OnActivate()
10 {
11 if (!game)
12 {
13 if (!prefab)
14 {
15 prefab = Resources.Load<Shooter>("Basket");
16 }
17 Debug.Log(prefab);
18 go = Object.Instantiate(prefab.gameObject);
19 Debug.Log(go);
20 game = go.GetComponentInChildren<Shooter>();
21 }
22 SetAudioMixer(go);
23 Shooter.game = new Game_Basket
24 {
25 Deactivate = base.Deactivate,
26 OnPlay = base.OnPlay,
27 ModChangeCoin = delegate(int a)
28 {
29 balance.changeCoin += a;
30 },
31 ModLastCoin = delegate(int a)
32 {
33 balance.lastCoin += a;
34 },
35 LastCoin = () => balance.lastCoin
36 };
37 EClass.scene.audioListener.enabled = false;
38 }
39
40 public override void SlidePosition(float w)
41 {
42 game.transCanvas.Rect().anchoredPosition = new Vector2(w / 2f, 0f);
43 }
44
45 public override void OnDeactivate()
46 {
47 Kill();
48 EClass.scene.audioListener.enabled = true;
49 }
50}
override void SlidePosition(float w)
override void OnActivate()
override void OnDeactivate()