Example #1
0
 public GameObject AddGameObject(params string[] tags)
 {
     var go = new GameObject(this);
     go.Tags = tags;
     _gameObjects.Add(go);
     return go;
 }
Example #2
0
        public override void OnCollision(GameObject with)
        {
            if (!with.Tags.Contains("enemy"))
                return;

            Kill();
        }
Example #3
0
        public override void OnCollision(GameObject with)
        {
            var withGameObject = (with as GameObject);
            if (!withGameObject.Tags.Contains("bullet"))
                return;

            AudioSource.Play();
            _cameraShaker.Shake();
            StartCoroutine(BeginRemove());
        }
Example #4
0
 /// <summary>
 /// Handles collisions with other GameObjects.
 /// </summary>
 /// <param name="withGameObject"></param>
 internal void HandlCollision(GameObject withGameObject)
 {
     ForEachBehavior(b => b.OnCollision(withGameObject));
 }
Example #5
0
 internal void RemoveGameObject(GameObject gameObject)
 {
     _gameObjects.Remove(gameObject);
 }
Example #6
0
 public virtual void OnCollision(GameObject with) { }
 public GameObjectConfigurator(GameObject gameObject)
 {
     _gameObject = gameObject;
 }
 public GameObjectComponentAdder(GameObject gameObject)
 {
     _gameObject = gameObject;
 }