private void CheckSetting() { if (ApplySetting != CurrentSetting) { CurrentSetting.ApplyToPlayer(this, ApplySetting); } }
public bool UsePickup(PlayerController pc) { if (pc.WillColliderHeightCollide(transform.position, Settings.GetCombinedGroupWithPlayer(pc).CharacterSettings.ColliderHeight)) { FailureIndicator.ShowFailureMessage("Not Enough Room", transform.position); return(false); } if (Settings.GetCombinedGroupWithPlayer(pc) == pc.CurrentSetting) { FailureIndicator.ShowFailureMessage("Already Have That Body Part", transform.position); return(false); } var overlap = Settings.GetOverlapGroupWithPlayer(pc); Settings.ApplyToPlayer(pc); pc.SetPositionToPickup(this); if (overlap.Head || overlap.Torso || overlap.Legs) { Settings = overlap; } else { Destroy(gameObject); } AudioManager.PlayOneShot(GameSettings.PickupPartSFX); return(true); }
private void Start() { _boxCollider = GetComponent <BoxCollider2D>(); ApplySetting?.ApplyToPlayer(this, ApplySetting); _entity = GetComponent <BaseEntity>(); _animController = GetComponent <Animator>(); _sRend = GetComponent <SpriteRenderer>(); if (_inputProvider == null) { _inputProvider = new PlayerInputProvider(); } }