void OnTriggerEnter(Collider other) { if (other.CompareTag("Tower")) { Pubsub.Publish(Pubsub.Type.GameOver, null); } }
void AddBloc(InteractiveBloc bloc) { tblocs.Add(bloc); bloc.transform.SetParent(transform); bloc.tag = "Tower"; bloc.GetComponent <Rigidbody>().Sleep(); // bloc.GetComponent<Rigidbody>().mass = 1000; Pubsub.Publish(Pubsub.Type.NewBlocOnTower, new object[] { tblocs.Count, bloc.gameObject }); }
void OnCollisionEnter(Collision other) { if (state != State.Dead && other.gameObject.CompareTag("Tower")) { state = State.Dead; initialPosition = transform.position; Destroy(ligthspot); Pubsub.Publish(Pubsub.Type.BlocTouchTower, this); } }
void InstantiateNewBloc() { GameObject bloc = Instantiate(blocPrefab); Pubsub.Publish(Pubsub.Type.NewInteractiveBloc, bloc); }