예제 #1
0
    public BossRoom()
    {
        CurrentRoom = this;

        Enemies = new List <Entity>();
        HarryHusky h = new HarryHusky();

        Enemies.Add(h);
        GameObject entityObject = Object.Instantiate(EntityMB.EntityPrefab, RoomMB.ActiveRoom.transform);
        EntityMB   entityMb     = entityObject.GetComponent <EntityMB>();

        entityMb.Init(h);
        entityObject.transform.localPosition = new Vector3(5.5f, 0, 0);
    }
예제 #2
0
 public void TeamUpdated()
 {
     foreach (EntityMB e in TeamEntities)
     {
         Destroy(e.gameObject);
     }
     TeamEntities.Clear();
     for (int i = 0; i < Player.Team.Count; i++)
     {
         GameObject newMember = Instantiate(EntityMB.EntityPrefab);
         //newMember.transform.position = new Vector3(0.9f + i * 1.7f, 6, 0);
         newMember.transform.position = new Vector3(3.5f, 6, 0);
         EntityMB newEntityMb = newMember.GetComponent <EntityMB>();
         newEntityMb.Init(Player.Team[i]);
         TeamEntities.Add(newEntityMb);
     }
 }
예제 #3
0
    public BattleRoom()
    {
        CurrentRoom = this;

        Enemies = new List <Entity>();

        int max = 1 + RoomGenerator.TotalRooms / 17;
        int n   = Random.Range(1, max + 1);

        for (int i = 0; i < n; i++)
        {
            Entity e = (Entity)Activator.CreateInstance(EnemyList.GetRandomEnemy());
            Enemies.Add(e);
            GameObject entityObject = Object.Instantiate(EntityMB.EntityPrefab, RoomMB.ActiveRoom.transform);
            EntityMB   entityMb     = entityObject.GetComponent <EntityMB>();
            entityObject.transform.localPosition = new Vector3(2 + i * 1.7f, 0, 0);
            entityMb.Init(e);
        }
    }