Exemple #1
0
        public void EnterExistingCombatInstance(HubEvents type, int combatInst, GameObject player, List <GameObject> enemies)
        {
            container.SetCombatInst(combatInst);
            container.battleType = type;
            if (!MusicManager.Instance.CheckBossThemePlaying())
            {
                if (type == HubEvents.Battle)
                {
                    MusicManager.Instance.ChangeScene(SceneType.Combat);
                }
                else
                {
                    MusicManager.Instance.ChangeToBossTheme();
                }
            }

            // Temporarily removes all player characters from the combat list
            int temp = playerChars.childCount;

            for (int i = 0; i < temp; ++i)
            {
                playerChars.GetChild(0).parent = nonCombatPlayerChars;
            }

            // Adds the participating player character to the combat list
            player.transform.parent = playerChars;
            player.GetComponent <CharData>().isInCombat = true;
            player.GetComponent <CharData>().combatInst = combatInst;

            Debug.Log(nonCombatPlayerChars.childCount);
            for (int i = 0; i < nonCombatPlayerChars.childCount; ++i)
            {
                if (nonCombatPlayerChars.GetChild(i).GetComponent <CharData>().combatInst == combatInst)
                {
                    nonCombatPlayerChars.GetChild(i).parent = playerChars;
                }
            }

            // Adds the enemies to the combat list
            for (int i = 0; i < enemies.Count; ++i)
            {
                if (!enemies[i].GetComponent <CharData>().dead)
                {
                    enemies[i].transform.parent = enemyChars;
                    enemies[i].GetComponent <CharData>().isInCombat = true;
                    enemies[i].GetComponent <CharData>().combatInst = combatInst;
                }
            }

            SetCharacterHubPositions();
            cam.StoreCameraHubPos();
            transitionUI.ExitScene("CombatScene");
        }
Exemple #2
0
 private void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         Instance = this;
     }
     foreach (GameObject go in GameObject.FindGameObjectsWithTag("Lamparina"))
     {
         Lamparinas.Add(go);
     }
     audioSource = GetComponent <AudioSource>();
 }
Exemple #3
0
 public void PassExistingCombat(HubEvents type)
 {
     //Managers.TurnManager.Instance.t1[0].GetComponent<CharacterController>().enabled = false;
     Managers.CombatTransitionManager.Instance.EnterExistingCombatInstance(type, eventNum, player, enemies);
 }
Exemple #4
0
 protected HubEvent(HubEvents eventType)
 {
     EventType = eventType;
 }
 public CarEvent(HubEvents eventType, int id) : base(eventType)
 {
     Id = id;
 }