diff --git a/Assets/Scripts/Pet/PetAttack.cs b/Assets/Scripts/Pet/PetAttack.cs index 35a7a1d84e909cfdf92d8fac6fecfba17c6e72a3..bed567748978d3412198713390e791f9851f5eb8 100644 --- a/Assets/Scripts/Pet/PetAttack.cs +++ b/Assets/Scripts/Pet/PetAttack.cs @@ -41,15 +41,22 @@ public class PetAttack : MonoBehaviour if(arrowMoveRendering) { - Vector3 targetPosition = enemyTarget.transform.position; - targetPosition.y = 0; + try + { + Vector3 targetPosition = enemyTarget.transform.position; + targetPosition.y = 0; - clonedArrow.transform.position = Parabola(arrowInCurrentBow.transform.position, targetPosition, 1, timerForArrow * 2 / 1f); - if(timerForArrow >= anim.GetCurrentAnimatorStateInfo(0).length) + clonedArrow.transform.position = Parabola(arrowInCurrentBow.transform.position, targetPosition, 1, timerForArrow * 2 / 1f); + if(timerForArrow >= anim.GetCurrentAnimatorStateInfo(0).length) + { + arrowMoveRendering = false; + } + gameObject.transform.LookAt(enemyTarget.transform); + } + catch (Exception e) { - arrowMoveRendering = false; + Debug.Log(e); } - gameObject.transform.LookAt(enemyTarget.transform); } else { @@ -86,7 +93,7 @@ public class PetAttack : MonoBehaviour arrowInCurrentBow = GameObject.Find("main_arrow"); clonedArrow = Instantiate(arrowPrefab, arrowInCurrentBow.transform.position, arrowInCurrentBow.transform.rotation); - + clonedArrow.gameObject.GetComponent<Arrow>().damageMultiplier = 100f; timer = 0f; timerForArrow = 0f; arrowMoveRendering = true; diff --git a/Assets/Scripts/Pet/PetHealth.cs b/Assets/Scripts/Pet/PetHealth.cs index 7faa3747d3fb65923ece499bfbf4bd34319a0dd8..1ddb755f06df9f15abee685ce43788efa61b16a2 100644 --- a/Assets/Scripts/Pet/PetHealth.cs +++ b/Assets/Scripts/Pet/PetHealth.cs @@ -79,9 +79,12 @@ public class PetHealth : MonoBehaviour anim.SetBool("Dead", true); PetBuff petBuff = pet.GetComponent<PetBuff>(); - if(petBuff.petType == PetTypeEnum.Aura) + if (petBuff != null ) { - petBuff.NormalizedAura(); + if(petBuff.petType == PetTypeEnum.Aura) + { + petBuff.NormalizedAura(); + } } Destroy(pet); diff --git a/Assets/customsave.cssav b/Assets/customsave.cssav index 7f0d677db5ae99b458f8bdffa292b87eb2c4f128..cda0600d43d94442d29a66ede8d6bac5e5922648 100644 Binary files a/Assets/customsave.cssav and b/Assets/customsave.cssav differ diff --git a/Assets/highestScore.json b/Assets/highestScore.json index 8cfa48313bf20f6bb31b219885999e6e2c03c22f..f0a783d5370c5b73a1892061a58cdf93754a39fa 100644 --- a/Assets/highestScore.json +++ b/Assets/highestScore.json @@ -1 +1 @@ -{"highestScoreList":[{"playerName":"CJ​","timeTakenToWin":525.9905395507813},{"playerName":"-​","timeTakenToWin":1000000000.0},{"playerName":"-​","timeTakenToWin":1000000000.0},{"playerName":"-​","timeTakenToWin":1000000000.0},{"playerName":"-","timeTakenToWin":1000000000.0}]} \ No newline at end of file +{"highestScoreList":[{"playerName":"Ucok​","timeTakenToWin":18.10793113708496},{"playerName":"Ucok​","timeTakenToWin":71.50775909423828},{"playerName":"CJ​","timeTakenToWin":525.9905395507813},{"playerName":"-​","timeTakenToWin":1000000000.0},{"playerName":"-​","timeTakenToWin":1000000000.0}]} \ No newline at end of file