AddResource() public method

public AddResource ( string newName ) : Entity
newName string
return Entity
	static IEnumerable LeaderboardCoroutine(Pool pool, Entity e, float startTime)
	{
		var audioSource = GameObject.Find("MusicSource").GetComponent<AudioSource>();
		
		for (int i = 3; i >= 0; --i)
		{
			audioSource.volume = 0.25f * (i / 3.0f);
			yield return WaitMs(e, 200);
		}
		
		audioSource.Stop();
		if(pool.hasLowestScoreLeaderboard && pool.lowestScoreLeaderboard.value <= pool.score.value)
		{
			audioSource.clip = (AudioClip)Resources.Load("Music/GameOverHighScore");
		}
		else
		{
			audioSource.clip = (AudioClip)Resources.Load("Music/GameOver");
		}
		audioSource.volume = 0.25f;
		audioSource.loop = false;
		audioSource.Play();
		
		yield return WaitMs(e, 1200);
		
		e.AddLeaderboard("");
		e.AddResource("Leaderboard");
	}
Esempio n. 2
0
 void createEnemy()
 {
     enemyEntity = pool.CreateEntity()
         .AddPosition(new Vector2(0.0f, 2.0f));
     component.resource = component.resource == null ? ResourceWithColliders.Enemy : component.resource;
     enemyEntity.AddResource(component.resource);
 }