public GameObject AddGameObject(params string[] tags) { var go = new GameObject(this); go.Tags = tags; _gameObjects.Add(go); return go; }
public override void OnCollision(GameObject with) { if (!with.Tags.Contains("enemy")) return; Kill(); }
public override void OnCollision(GameObject with) { var withGameObject = (with as GameObject); if (!withGameObject.Tags.Contains("bullet")) return; AudioSource.Play(); _cameraShaker.Shake(); StartCoroutine(BeginRemove()); }
/// <summary> /// Handles collisions with other GameObjects. /// </summary> /// <param name="withGameObject"></param> internal void HandlCollision(GameObject withGameObject) { ForEachBehavior(b => b.OnCollision(withGameObject)); }
internal void RemoveGameObject(GameObject gameObject) { _gameObjects.Remove(gameObject); }
public virtual void OnCollision(GameObject with) { }
public GameObjectConfigurator(GameObject gameObject) { _gameObject = gameObject; }
public GameObjectComponentAdder(GameObject gameObject) { _gameObject = gameObject; }