private GameObject CreateMonster(GameObject door, AssemblyCSharp.MonsterTemplate monsterTemplate)
	{
		GameObject prefab = getPrefab (monsterTemplate.getType());

		List<float> position = Instantiation.instance.getMonsterWalkablePositions ();
		int posIndex = Random.Range (0, position.Count);

		Vector3 pos = new Vector3 (door.transform.localPosition.x + 3 * door.transform.right.x,
		                           prefab.transform.position.y,
		                           position[posIndex]);
		GameObject monster = InstantiateMonster (prefab, pos); 
		monster.GetComponent<AbstractMonsterController> ().setSpeed (monsterTemplate.getSpeed());
		return monster;
	}
 public void RegisterObserver(AssemblyCSharp.IClassicTetrisStateObserver observer)
 {
     if (!mRegisteredObservers.Contains (observer))
                         mRegisteredObservers.Add (observer);
 }
 private void NotifyObservers(AssemblyCSharp.ClassicTetrisStateUpdate stateUpdate)
 {
     foreach (AssemblyCSharp.IClassicTetrisStateObserver observer in mRegisteredObservers) {
                         observer.notify (stateUpdate);
                 }
 }
 public void UnregisterObserver(AssemblyCSharp.IClassicTetrisStateObserver observer)
 {
     mRegisteredObservers.Remove (observer);
 }
Beispiel #5
0
 void OnButtonMouseUp(object sender, AssemblyCSharp.ButtonEventArgs e)
 {
 }
Beispiel #6
0
 public void UnregisterObserver(AssemblyCSharp.IMenuObserver observer)
 {
     mRegisteredObservers.Remove (observer);
 }
Beispiel #7
0
 public void RegisterObserver(AssemblyCSharp.IMenuObserver observer)
 {
     mRegisteredObservers.Add (observer);
 }
Beispiel #8
0
 void AssemblyCSharp.IClassicTetrisStateObserver.notify(AssemblyCSharp.ClassicTetrisStateUpdate stateUpdate)
 {
     if (stateUpdate == AssemblyCSharp.ClassicTetrisStateUpdate.GameEnded) {
                     menuFunction = mainMenu;
             }
 }
Beispiel #9
0
 private void NotifyObservers(AssemblyCSharp.GameState newState)
 {
     foreach (AssemblyCSharp.IMenuObserver observer in mRegisteredObservers) {
                     observer.notify (newState);
             }
 }