// Start is called before the first frame update void Start() { Character Player1 = Character1.GetComponent <Character>(); Character Player2 = Character2.GetComponent <Character>(); Character Player3 = Character3.GetComponent <Character>(); Character Player4 = Character4.GetComponent <Character>(); Enemy Enemy1 = EnemyBattler.GetComponent <Enemy>(); //Jag vet inget mer effektivt sätt att samla allt i en Public lista än det här CharacterList.Add(Player1); CharacterList.Add(Player2); CharacterList.Add(Player3); CharacterList.Add(Player4); EnemyList.Add(Enemy1); PositionList.Add(Character1); PositionList.Add(Character2); PositionList.Add(Character3); PositionList.Add(Character4); attackButton.onClick.AddListener(Attack); skillButton.onClick.AddListener(Skills); personaButton.onClick.AddListener(Personas); guardButton.onClick.AddListener(Guard); cancel.onClick.AddListener(Cancel); dataHandler = dataHandlerOBJ.GetComponent <Ownership>(); }
public void StartNPCBattle(Character2 character2, Character2 npc) { this.character2 = character2; this.npc = npc; isNPCbattle = true; player = character2.GetComponent <PlayerMovement>(); boss = npc.GetComponent <BossController>(); StartCoroutine(SetUpBattle()); }
public void SetCharactersInit(GameObject C1, GameObject C2) { Character1 = (GameObject)Instantiate(C1, CharacterPos1.position, Quaternion.identity); Character2 = (GameObject)Instantiate(C2, CharacterPos2.position, Quaternion.identity); Character1.transform.SetParent(CharacterPos1); Character2.transform.SetParent(CharacterPos2); CharacterBase1 = Character1.GetComponent <CharacterBase>(); CharacterBase2 = Character2.GetComponent <CharacterBase>(); CharacterPos1.GetComponent <TriggerRange>().m_CharacterBase = CharacterBase1; CharacterPos2.GetComponent <TriggerRange>().m_CharacterBase = CharacterBase2; }