private void Start() { gameMgr = GetComponent <InGameMgr>(); if (FusionOkBtn != null) { FusionOkBtn.onClick.AddListener(() => { FusionOkFuc(); }); } //InvokeRepeating("FusionItemView", 0, 0.3f); }
public void Awake() { for (int i = 0; i < m_listButton.Count; i++) { int p_nIndex = i; m_listButton[i].onClick.AddListener(() => { OnButtonPress(p_nIndex); }); } gameMgr = GameObject.Find("InGameMgr").GetComponent <InGameMgr>(); }
private void Start() { gr = GameObject.Find("Canvas").GetComponent <GraphicRaycaster>(); ped = new PointerEventData(null); gameMgr = GameObject.Find("InGameMgr").GetComponent <InGameMgr>(); fusionMgr = GameObject.Find("InGameMgr").GetComponent <FusionMgr>(); for (int i = 0; i < gameMgr.ItemArray.Length; i++) { if (gameMgr.ItemArray[i] == this.GetComponent <Button>()) { idx = i; } } for (int i = 0; i < gameMgr.FusionItemArray.Length; i++) { if (gameMgr.FusionItemArray[i] == this.GetComponent <Button>()) // 0 ~ 19 => 인벤토리 { idx = i; } } for (int i = 0; i < gameMgr.EquipArray.Length; i++) { if (gameMgr.EquipArray[i] == this.GetComponent <Button>()) // 20 ~ 25 => 장착한 아이템 { idx = i + 20; } } for (int i = 0; i < gameMgr.FusionArray.Length; i++) { if (gameMgr.FusionArray[i] == this.GetComponent <Button>()) // 26 ~ 27 => Fusion 재료 { idx = i + 26; } } defaultPos = transform.position; }
private void Start() { print(c_index); //기본 셋팅 damage += growth_Damage * (unitGrade - 1); defense += growth_Defense * (unitGrade - 1); health += growth_Health * (unitGrade - 1); atkCoolTime = skillCoolTime; DeadAnimTime = 3f; nowHealth = health; //HpImg.fillAmount = nowHealth / health; this.gameObject.transform.localScale = new Vector2(characterScale, characterScale); AttackedList = new List <GameObject>(); animator = this.GetComponent <Animator>(); projectileObj = Resources.Load("Arrow") as GameObject; gameMgr = GameObject.Find("InGameMgr").GetComponent <InGameMgr>(); ChangeState(State.Move); }