Ejemplo n.º 1
0
    public void AddAiPlayer(Vector2 position, IMoveableObject target, float difficulty = 1.0f)
    {
        GameObject model  = GameObject.Instantiate(PaddleModel, new Vector3(position.x, position.y), Quaternion.identity);
        AiPlayer   player = model.AddComponent <AiPlayer>();

        player.SetTarget(target);
        player.SetSpeed(8.0f);
        player.SetDifficulty(difficulty);
        Players.Add(player);
    }