Ejemplo n.º 1
0
    private void BeginGame()
    {
        roomInstance = Instantiate(roomPrefab) as Room;
        roomInstance.Generate();

        playerCharA = Instantiate(characterPrefab) as Character;
        //playerCharA.characterPrefab.SetParentChar(playerCharA);
        //playerCharA.characterPrefab.name = "Hero A Prefab";
        playerCharA.Generate(new Vector3(-5.0f, -5.0f, -0.5f));
        //playerCharA.actionQueue.ParentChar = playerCharA;
        //playerCharA.tag = "Hero A";
        playerCharA.name = "Hero A";

        /*playerCharA.stats.Name = "Hero A";
         * playerCharA.stats.MaxHealth = 50;
         * playerCharA.stats.MaxMana = 30;
         * playerCharA.stats.Strength = 7;
         * playerCharA.stats.Agility = 5;
         * playerCharA.stats.Intelligence = 5;
         * playerCharA.stats.InitializeCombatStats ();*/
        playerCharA.gameObject.AddComponent("ClickToMove");

        /*playerCharB = Instantiate (characterPrefab) as Character;
         * playerCharB.characterPrefab.SetParentChar (playerCharB);
         * playerCharB.characterPrefab.name = "Hero B Prefab";
         * playerCharB.Generate (new Vector3 (-2.7f, 0f, 0f));
         * playerCharB.actionQueue.ParentChar = playerCharB;
         * playerCharB.tag = "Hero B";
         * playerCharB.name = "Hero B";
         * playerCharB.stats.Name = "Hero B";
         * playerCharB.stats.MaxHealth = 40;
         * playerCharB.stats.MaxMana = 30;
         * playerCharB.stats.Strength = 5;
         * playerCharB.stats.Agility = 8;
         * playerCharB.stats.Intelligence = 5;
         * playerCharB.stats.InitializeCombatStats ();
         * playerCharB.stats.AttackRange = 5.0f;*/

        /*playerCharC = Instantiate (characterPrefab) as Character;
         * playerCharC.characterPrefab.name = "Hero C Prefab";
         * playerCharC.characterPrefab.SetParentChar(playerCharC);
         * playerCharC.Generate (new Vector3 (-2.7f, 5.0f, 0f));
         * playerCharC.actionQueue.ParentChar = playerCharC;
         * playerCharC.tag = "Hero C";
         * playerCharC.name = "Hero C";
         * playerCharC.stats.Name = "Hero C";
         * playerCharC.stats.MaxHealth = 30;
         * playerCharC.stats.MaxMana = 50;
         * playerCharC.stats.Strength = 3;
         * playerCharC.stats.Agility = 5;
         * playerCharC.stats.Intelligence = 8;
         * playerCharC.stats.InitializeCombatStats ();
         * playerCharC.stats.AttackRange = 4.0f;
         * playerCharC.stats.MagicAttack = true;*/

        enemy = Instantiate(characterPrefab) as Character;
        enemy.characterPrefab.name = "Enemy Prefab";
        //enemy.characterPrefab.SetParentChar(enemy);
        enemy.Generate(new Vector3(2.7f, 5f, -0.5f));
        enemy.setMaterial(enemyMaterial);
        enemy.name = "Enemy";

        /*enemy.stats.Name = "Enemy";
         * enemy.stats.MaxHealth = 50;
         * enemy.stats.MaxMana = 30;
         * enemy.stats.Strength = 5;
         * enemy.stats.Agility = 5;
         * enemy.stats.Intelligence = 5;
         * enemy.stats.InitializeCombatStats ();*/
        enemy.gameObject.AddComponent("EnemyMovement");


        //playerCharA.setTarget(enemy);
        enemy.setTarget(playerCharA);

        enemies.addEnemy(enemy);
    }