void OnTriggerEnter(Collider other) { if (other.CompareTag("Tower")) { Pubsub.Publish(Pubsub.Type.GameOver, null); } }
public override int GetHashCode() { int hash = 1; if (Name.Length != 0) { hash ^= Name.GetHashCode(); } if (Entrypoint.Length != 0) { hash ^= Entrypoint.GetHashCode(); } if (resources_ != null) { hash ^= Resources.GetHashCode(); } if (triggers_ != null) { hash ^= Triggers.GetHashCode(); } if (pubsub_ != null) { hash ^= Pubsub.GetHashCode(); } hash ^= files_.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
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); } }
public void MergeFrom(JobSpec other) { if (other == null) { return; } if (other.Name.Length != 0) { Name = other.Name; } if (other.Entrypoint.Length != 0) { Entrypoint = other.Entrypoint; } if (other.resources_ != null) { if (resources_ == null) { Resources = new global::Toit.Proto.Model.JobResources(); } Resources.MergeFrom(other.Resources); } if (other.triggers_ != null) { if (triggers_ == null) { Triggers = new global::Toit.Proto.Model.JobTriggers(); } Triggers.MergeFrom(other.Triggers); } if (other.pubsub_ != null) { if (pubsub_ == null) { Pubsub = new global::Toit.Proto.Model.JobSpec.Types.PubSub(); } Pubsub.MergeFrom(other.Pubsub); } files_.Add(other.files_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
public void Dispose() { Pubsub.Unregister(type, callback); }
public PubsubHandler(Pubsub.Type type, Action <object> callback) { Pubsub.Register(type, callback); this.callback = callback; this.type = type; }
void InstantiateNewBloc() { GameObject bloc = Instantiate(blocPrefab); Pubsub.Publish(Pubsub.Type.NewInteractiveBloc, bloc); }