Example #1
0
    void Start()
    {
        //sphereCast = new SphereCast();

        WriteText("test_", lines, columns);
        createMap("map");

        selfSpawner  = GameObject.FindGameObjectWithTag("Spawner").transform;
        enemPosition = new List <Vector3>();

        playerPrefab = GameObject.FindGameObjectWithTag("Player");
        gamePrefab   = GameObject.FindGameObjectWithTag("Game");

        playerCmd = playerPrefab.GetComponent <PlayerComand>();
        saveLoad  = gamePrefab.GetComponent <SaveLoadGame>();

        sphereCast = playerCmd.GetComponent <SphereCast>();

        // maneira a ser lida pelo editor da unity
        theSourceFile = new FileInfo("Assets\\StreamingAssets\\test_" + myId + ".txt");

        //maneira para enviar para build
        //theSourceFile = new FileInfo("A Light Before - Prototype_Data\\StreamingAssets\\test_" + myId + ".txt");

        reader = theSourceFile.OpenText();

        //createEnemies("map");
        //print("passou aqui");
        //LoadText("map");

        createEnemies(lines);

        for (int i = 0; i < enemyList.Count; i++)
        {
            enemyMatCtrl = enemyList[i].GetComponent <EnemyMatCtrl>();
        }
    }
Example #2
0
 // Use this for initialization
 void Start()
 {
     playerPrefab = GameObject.FindGameObjectWithTag("Player");
     playerCmd    = playerPrefab.GetComponent <PlayerComand>();
     sphereCast   = playerCmd.GetComponent <SphereCast>();
 }