public void Init(Battle battle) { this.battle = battle; Battlefield battlefield = GameObject.Instantiate(battlefieldSource) as Battlefield; battlefield.transform.parent = transform; battlefield.transform.localPosition = Vector3.zero; battlefield.transform.localRotation = Quaternion.identity; actionCardsPool.Init(actionCardSource); resultCardsPool.Init(resultCardSource); foreach (Character ally in battle.allies) { CharacterView characterView = GameObject.Instantiate(characterViewSource) as CharacterView; characterView.Init(ally); ally.atbGaugeFullEvent += ATBGaugeFull; } foreach (Character enemy in battle.enemies) { CharacterView characterView = GameObject.Instantiate(characterViewSource) as CharacterView; characterView.Init(enemy); } }
void Start() { model.Init(); view.Init(model); view.OnBackButtonClicked += View_OnBackButtonClicked; view.OnNextButtonClicked += View_OnNextButtonClicked; view.OnPrevButtonClicked += View_OnPrevButtonClicked; view.OnSelectButtonClicked += View_OnSelectButtonClicked; }
public override void OnRegister() { CharacterView.Init(); dispatcher.AddListener(ViewEvent.DealCard, OnDealCard); dispatcher.AddListener(ViewEvent.CompleteDeal, OnCompleteDeal); dispatcher.AddListener(ViewEvent.DealThreeCards, OnDealThreeCards); dispatcher.AddListener(ViewEvent.RequestPlay, OnPlayerPlayCard); dispatcher.AddListener(ViewEvent.SuccessedPlay, OnSuccessedPlay); RoundModel.ComputerHandle += Roundmodel_ComputerHandle; RoundModel.PlayerHandle += RoundModel_PlayHandle; }
////////////////////////////////////////// /// SetUpCharacters() ////////////////////////////////////////// private void SetUpCharacters() { // set the player and monster views ProtoCharacterData charPlayer = IDL_ProtoCharacters.GetCharacter("Finthis"); CharacterView viewPlayer = GetViewFromType(CharacterTypes.Player); viewPlayer.Init(charPlayer); ProtoCharacterData charMonster = IDL_ProtoCharacters.GetCharacter("Goblin"); CharacterView viewMonster = GetViewFromType(CharacterTypes.AI); viewMonster.Init(charMonster); // add the data to our list m_listData.Add(charPlayer); m_listData.Add(charMonster); }
////////////////////////////////////////// /// SetUpCharacters() ////////////////////////////////////////// private void SetUpCharacters() { // set the player and monster views // TODO: Load from player data! ProtoCharacterData charPlayer = IDL_ProtoCharacters.GetCharacter("Finthis"); CharacterView viewPlayer = GetViewFromType(CharacterTypes.Player); viewPlayer.Init(charPlayer); ProtoCharacterData charMonster = IDL_ProtoCharacters.GetCharacter("Goblin"); CharacterView viewMonster = GetViewFromType(CharacterTypes.AI); viewMonster.Init(charMonster); // add the data to our list m_listData.Add(charPlayer); m_listData.Add(charMonster); // let the game know characters have been set up Messenger.Broadcast("CharactersSetUp"); }
public void StartConversation(Character other) { _current = other; playerCharacterView.Init(playerCharacter, Expression.Default); otherCharacterView.Init(other, Expression.Default); }
public void Init() { Status = new CharacterStatus(hp: 10, maxHp: 10); View.Init(Status); }