Exemplo n.º 1
0
    private void InitBases()
    {
        GameObject baseSpawn = GameObject.FindGameObjectWithTag("AllyBaseSpawn");

        if (baseSpawn != null)
        {
            GameObject allyBaseObj = Instantiate(ResourcesData.GetObject(ResourcesData._bases, BasesEnum.BASE), baseSpawn.transform.position, baseSpawn.transform.rotation) as GameObject;
            _allyBaseManager = allyBaseObj.GetComponent <AllyBaseManager>();
            _allyBaseManager.InitRobots();
        }
        else
        {
            throw new System.Exception("Ally base spawn not found");
        }

        baseSpawn = GameObject.FindGameObjectWithTag("EnnemyBaseSpawn");
        if (baseSpawn != null)
        {
            GameObject ennemyBaseObj = Instantiate(ResourcesData.GetObject(ResourcesData._bases, BasesEnum.ENNEMYBASE), baseSpawn.transform.position, baseSpawn.transform.rotation) as GameObject;
            _ennemyBaseManager = ennemyBaseObj.GetComponent <EnnemyBaseManager>();
            _ennemyBaseManager.InitRobots();
        }
        else
        {
            throw new System.Exception("Ennemy base spawn not found");
        }
    }
Exemplo n.º 2
0
    protected override void Start()
    {
        base.Start();

        _baseManager = GetComponent <EnnemyBaseManager>();
    }