コード例 #1
0
 void handleDeath()
 {
     spriteRenderer.sprite = sprite;
     isDead = true;
     Destroy(gameObject, 4);
     EnemyAchievement.incrementEnemyCount();
 }
コード例 #2
0
    void handleDeath()
    {
        spriteRenderer.sprite = sprite;
        Destroy(gameObject, 2);
        isDead = true;
        EnemyAchievement.incrementEnemyCount();
        AudioSource deathSound = gameObject.AddComponent <AudioSource>();

        deathSound.clip = Resources.Load("Audio/glass_break") as AudioClip;
        deathSound.Play();
    }
コード例 #3
0
	//Build list of achievements, with the key being a string of the goal
	public void makeAchievements() {

		string tempPlatformKey = "Bounced on 100 platforms!";
		PlatformAchievement tempPlatform = new PlatformAchievement(tempPlatformKey, 100);
		achievementList.Add(tempPlatform);

		string tempItemKey = "Picked up 50 items!";
		ItemAchievement tempItem = new ItemAchievement(tempItemKey, 50);
		achievementList.Add (tempItem);
		
		string tempPlayKey = "Played 10 times!";
		PlayAchievement tempPlay = new PlayAchievement(tempPlayKey, 10);
		achievementList.Add (tempPlay);

		string tempEnemyKey = "Defeat 20 enemies!";
		EnemyAchievement tempEnemy = new EnemyAchievement (tempEnemyKey, 20);
		achievementList.Add (tempEnemy);

	}
コード例 #4
0
    //Build list of achievements, with the key being a string of the goal
    public void makeAchievements()
    {
        string tempPlatformKey           = "Bounced on 100 platforms!";
        PlatformAchievement tempPlatform = new PlatformAchievement(tempPlatformKey, 100);

        achievementList.Add(tempPlatform);

        string          tempItemKey = "Picked up 50 items!";
        ItemAchievement tempItem    = new ItemAchievement(tempItemKey, 50);

        achievementList.Add(tempItem);

        string          tempPlayKey = "Played 10 times!";
        PlayAchievement tempPlay    = new PlayAchievement(tempPlayKey, 10);

        achievementList.Add(tempPlay);

        string           tempEnemyKey = "Defeat 20 enemies!";
        EnemyAchievement tempEnemy    = new EnemyAchievement(tempEnemyKey, 20);

        achievementList.Add(tempEnemy);
    }