// Update is called once per frame void Update() { if (countBodyParts == countDeadEnemies) { TriggerWinPanel(); GooglePlayGamesServices.UnlockAchievement(SlingshotSoldier.GPGSIds.achievement_full_body); } }
void Die() { transform.parent.gameObject.GetComponent <EnemyManager>().countDeadEnemies++; Instantiate(deathEffect, transform.position, Quaternion.identity); Handheld.Vibrate(); if (!firstSpark) { GooglePlayGamesServices.UnlockAchievement(SlingshotSoldier.GPGSIds.achievement_first_spark); firstSpark = true; } //EnemiesAlive--; if (!isAlive) { Debug.Log("Body Part Destroyed!"); } Destroy(gameObject); }