void Awake() { player = Player.instance; enmTotalPool = EnmTotalPool.instance; mgcTotalPool = MgcTotalPool.instance; magicViewer.GetComponent <MagicViewer>().OnHit += OnHitMagic; enemies = Enemies.instance; }
//public Component touchrune; // 여기서의 문제점. touchrune 스크립트를 여러개가 공유하는데, 어떻게 지정을 하는지? // 생각되는 방법으로는 각각의 오브젝트마다 다 지정을하는건데, 이러면 public static으로 만든 이벤트에 영향이? // 그리고 매우 불편한데, 그러면 touchrune을 하나의 오브젝트(runeset)으로 해서 만들어야하는지? void Awake() { Component[] runeHands = RuneHands.GetComponentsInChildren <RuneHand>(); foreach (RuneHand runeHand in runeHands) { runeHand.OnChangeMagicSpace += OnChangeMagicSpace; } mgcTotalPool = MgcTotalPool.instance; }
private void Awake() { if (instance != null) { Destroy(gameObject); return; } instance = this; DontDestroyOnLoad(gameObject); string filepath = Application.dataPath + "/rune31/Scripts/GameData/" + "newMagic.json"; string jsons = File.ReadAllText(filepath); totalPool = JsonConvert.DeserializeObject <_Magics>(jsons).Magics; totalList = (from f in totalPool from e in f.Value from c in e.Value select c.Value).ToList(); Debug.Log("in MgcTotalPool : totalList" + "\n" + totalList.Count); }