public void LoadUltimate(int slotId) { if (_core == null) { _core = Camera.main.GetComponent <MainCore>(); } if (_battleCon == null) { _battleCon = _core._battleCon; } GameObject slot = Instantiate(_attackSlot); slot.transform.SetParent(transform.Find("ActionMask").Find("GridView")); slot.transform.localScale = new Vector3(1, 1, 1); slot.transform.localPosition = Vector3.zero; if (getSpriteSet != _battleCon._heroData[slotId].hero.hero.spriteSet) { getSpriteSet = _battleCon._heroData[slotId].hero.hero.spriteSet; loadSprite = Resources.LoadAll <Sprite>("Sprites/Character/Hero/" + getSpriteSet); } slot.transform.Find("Icon").GetComponent <Image>().sprite = loadSprite.Single(s => s.name == "Map_" + _battleCon._heroData[slotId].hero.hero.spriteName); slot.transform.Find("Image").GetComponent <Image>().sprite = loadSprite.Single(s => s.name == "Ultimate_" + _battleCon._heroData[slotId].hero.hero.spriteName); SkillBlock skill = new SkillBlock(); skill.slotId = _blockCount; skill.defCrystal = _battleCon._heroData[slotId].hero.attack[1].skill.crystal; slot.transform.Find("Crystal").GetComponentInChildren <Text>().text = skill.defCrystal.ToString(); skill.heroStoreId = _battleCon._heroData[slotId].hero.id; skill.blockStack = 1; skill.color = _battleCon._heroData[slotId].slotId; skill.isAttack = true; skill.isUltimate = true; skill.crystal = skill.defCrystal; skill.obj = slot; AttackSlot atk = slot.GetComponent <AttackSlot>(); atk._skill = skill; _attackList.Add(skill); _blockCount++; transform.Find("ActionMask").Find("GridView").localPosition = new Vector3(1, 0, 0); }
private void Awake() { _core = Camera.main.GetComponent <MainCore>(); _battleCon = _core._battleCon; }