private void OnGridCollision(GridTransform other) { if (other.GetComponent <Player>() != null) { CEventSystem.BroadcastEvent(EventChannel.gameState, EventSubChannel.none, new GameOverEvent()); } }
private void OnGridCollision(GridTransform other) { if (other.GetComponent <Player>() != null) { Destroy(gameObject); CEventSystem.BroadcastEvent(EventChannel.gameState, EventSubChannel.none, new GameState.WinLevelEvent()); } }
void OnGridCollision(GridTransform other) { //determite if the thing I collided with is the player if (other.GetComponent <gridTut>() != null) { //if it is, destory my gameobject Destroy(gameObject); } }
void OnGridCollision(GridTransform other) { //Determine if the thing I collided with is the player if (other.GetComponent <TutorialGridEntity>() != null) { //If it is, destroy my gameObject Destroy(gameObject); } }
private void OnGridCollision(GridTransform other) { GreenSlime slime = other.GetComponentInParent <GreenSlime>(); if (slime == this) { return; } Player player = other.GetComponent <Player>(); if (player != null) { Destroy(gameObject); CEventSystem.BroadcastEvent(EventChannel.gameState, EventSubChannel.none, new GrowEvent(GameState.SnakeGrowCount)); CEventSystem.BroadcastEvent(EventChannel.gameState, EventSubChannel.none, new GameState.EnemyDestroyedEvent()); } }