diff --git a/MrBigsock/Assets/Code/PlayerController.cs b/MrBigsock/Assets/Code/PlayerController.cs index 263181b6a8ebc924f19d05915382ca7ab255ba6c..d07507999d825f65ae26b8ebbcc9a6858d8fdbf2 100644 --- a/MrBigsock/Assets/Code/PlayerController.cs +++ b/MrBigsock/Assets/Code/PlayerController.cs @@ -32,7 +32,7 @@ namespace BigSock { - + protected IAttack _testAttack = new BasicProjectile1(); public DateTime NextTimeCanAttack { get; private set; } = DateTime.Now; @@ -52,6 +52,7 @@ namespace BigSock { TryPickUpItem(ItemService.SINGLETON.Get(201)); TryPickUpItem(ItemService.SINGLETON.Get(201)); TryPickUpItem(ItemService.SINGLETON.Get(202)); + var tmp = PrefabService.SINGLETON; } @@ -98,10 +99,12 @@ namespace BigSock { if (Input.GetKeyDown(KeyCode.Space) || Input.GetMouseButton(0)) { // Manage attack cooldown. if(NextTimeCanAttack <= DateTime.Now) { - NextTimeCanAttack = DateTime.Now.AddSeconds(AttackCooldown); + //NextTimeCanAttack = DateTime.Now.AddSeconds(AttackCooldown); + + //var bullet = Instantiate(attack, new Vector3(transform.position.x, transform.position.y, transform.position.z), attack.transform.rotation); + //bullet.GetComponent<AttackMovement>().Actor = this; - var bullet = Instantiate(attack, new Vector3(transform.position.x, transform.position.y, transform.position.z), attack.transform.rotation); - bullet.GetComponent<AttackMovement>().Actor = this; + _testAttack.Use(this, Camera.main.ScreenToWorldPoint(Input.mousePosition)); } }