void OnTriggerEnter2D(Collider2D c) { if (c.CompareTag("Hookable")) { partManag.SendMessage("generateSalivaSplash", transform.position + offsetToHookPoint); hookedObject = c.gameObject; offsetToHookPoint = transform.position - hookedObject.transform.position; offsetToHookPoint = Quaternion.Inverse(hookedObject.transform.rotation) * offsetToHookPoint; Rigidbody2D hookBody = GetComponent <Rigidbody2D>(); hookBody.isKinematic = true; hookBody.velocity = Vector3.zero; hookGun.HookOn(); GetComponent <CircleCollider2D>().enabled = false; } else if (!TagsToIgnore(c)) { hookGun.CancelHook(); } if (c.CompareTag("Edible")) { Destroy(c.gameObject); hookGun.CancelHook(); } }
void Grounded(bool isGrounded) { if (isGrounded) { if (reggiebody.velocity.y <= speedForDust) { PartMang.SendMessage("generateDust", transform.position + offSet); } grounded = true; } else { if (!isRunning) { StartCoroutine(SetGrounded(isGrounded)); } } }
void FixedUpdate() { if (!triggerMove) { setHorizontalAxis(Input.GetAxisRaw("Horizontal")); } stateProcesses[(int)state](); if (speed > defaultMaxSpeed) { speed -= MOVESPEED_DECREASE_DELTA * Time.deltaTime * Mathf.Pow(speed / defaultMaxSpeed, 3); } else { speed = defaultMaxSpeed; } if (Mathf.Abs(player.velocity.x) >= speedForParticles) { PEM.SendMessage("generateSpeedParticles", transform.position); } }