private void Throw() { if (this.grabController) { this.grabController.Throw(base.GetAimRay().direction *GrabSuccess.throwForce); this.grabController = null; this.target = null; } }
private void AttemptGrab(float grabRadius) { if (this.grabController) { return; } Ray aimRay = base.GetAimRay(); BullseyeSearch search = new BullseyeSearch { teamMaskFilter = TeamMask.GetEnemyTeams(base.GetTeam()), filterByLoS = false, searchOrigin = this.grabTransform.position, searchDirection = Random.onUnitSphere, sortMode = BullseyeSearch.SortMode.Distance, maxDistanceFilter = grabRadius, maxAngleFilter = 360f }; search.RefreshCandidates(); search.FilterOutGameObject(base.gameObject); HurtBox target = search.GetResults().FirstOrDefault <HurtBox>(); if (target) { if (target.healthComponent && target.healthComponent.body) { if (BodyMeetsGrabConditions(target.healthComponent.body)) { this.grabController = target.healthComponent.body.gameObject.AddComponent <RegigigasGrabController>(); this.grabController.pivotTransform = this.grabTransform; this.grabController.grabberHealthComponent = base.healthComponent; this.grabTarget = target; return; } } } }