private void OnTriggerEnter(Collider other) { if (CanCollect) { OnCollect?.Invoke(this.transform.gameObject); } }
public Response Push(Frame frame) { lock (Sync) { if (frame.Opcode == 0 && IncomingOpcode == 0) { return(Response.MessageNotStarted); } if (frame.Opcode != 0 && IncomingOpcode != 0) { return(Response.MessageNotFinished); } if (frame.Opcode != 0) { IncomingOpcode = frame.Opcode; } IncomingMessage.Write(frame.Masked ? Frame.FlipMask(frame.Payload, frame.Mask) : frame.Payload); if (!frame.FIN) { return(Response.OK); } ulong length = IncomingMessage.BufferedReadable; OnCollect?.Invoke(new Message(IncomingOpcode, IncomingMessage.Read(), length)); IncomingOpcode = 0; return(Response.Reset); } }
private IEnumerator TranslateMealToMouth() { if (!isCollectible) { yield break; } _collider2D.enabled = false; _rb.bodyType = RigidbodyType2D.Static; while (Vector3.Distance(transform.position, _catMouth.position) > 0.3f) { transform.position = Vector3.MoveTowards(transform.position, _catMouth.position, _step); if (transform.lossyScale.x > 0.8f) { var mealTransform = transform; var scale = mealTransform.localScale.x; scale -= 0.01f; mealTransform.localScale = new Vector3(scale, scale, scale); } yield return(Yielders.FixedUpdate); } if (!isFreezeEvent) { OnCollect?.Invoke(gameObject); isCollectedEvent.Invoke(); DestroyObject(); } else { Reject(); } }
private void OnTriggerEnter2D(Collider2D collision) { OnCollect?.Invoke(this, new OnCollectArgs() { collectable = this, collector = collision.gameObject }); Destroy(gameObject); }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Player") { Destroy(gameObject, 0.2f); OnCollect?.Invoke(this); } }
public override void Collect() { _playerData.Coins++; Destroy(this.gameObject); OnCollect?.Invoke(); }
public void ReduceSatietyNonCollectible() { if (_isTouched) { return; } _isTouched = true; OnCollect?.Invoke(gameObject); Debug.Log("-"); }
public override void Interact(Interactor interactor) { if (OnCollect != null) { OnCollect.Invoke(new CollectableEventData(gameObject, isWinItem)); } if (collectionSound != null) { interactor.GetComponent <AudioSource>().PlayOneShot(collectionSound); } Destroy(gameObject); }
private void OnTriggerEnter2D(Collider2D collision) { Debug.Log($"[{nameof(SwordCollectible)}] TriggerEnter2D"); if (collision.CompareTag(playerTag)) { Debug.Log($"[{nameof(SwordCollectible)}] it's the player"); OnCollect?.Invoke(collision.GetComponent <Player>()); PoolManager.Instance.Destroy(gameObject); } }
public virtual void Collect(Entity collecter) { Data.PickupEffects.ApplyEffects(collecter); OnCollect.Invoke(this, collecter); PinouApp.Pooler.Store(gameObject); }
public void Collect() { score += 1; OnCollect?.Invoke(score); }
internal void CollectHandler(CallEventParams.CollectParams collectParams) { OnCollect?.Invoke(mAPI, this, collectParams); }
public void AddItem(ItemType item) { inventory.TryGetValue(item, out int count); inventory[item] = count + 1; OnCollect?.Invoke(this, item); }
public void Collect(GameObject item) { // trigger the event OnCollect?.Invoke(item); isSelecting = false; }
public void AddLargeCollectible() { CollectiblesLarge += 1; OnCollect.Invoke(); }
public void AddSmallCollectible() { CollectiblesSmall += 1; OnCollect.Invoke(); }