public void Switch() { if (!Allowed) { return; } if (!Enable) { _MainCamera.fieldOfView = EnableFOV; PostProcessingController.Instance.AimScope.Enable = true; UiSys.CloseUi(AIM_POINT_UI_NAME); _PlayerSensitive.AddBuff(_AimScopeSensitiveScale, Operator.Mul, 0); PostProcessingController.Instance.DepthOfField.Enable = true; } else { _MainCamera.fieldOfView = _BaseFOV; PostProcessingController.Instance.AimScope.Enable = false; UiSys.OpenUi(AIM_POINT_UI_NAME); _PlayerSensitive.RemoveBuff(_AimScopeSensitiveScale); PostProcessingController.Instance.DepthOfField.Enable = false; } Enable = !Enable; }
protected override void Awake() { base.Awake(); rb2d = GetComponent <Rigidbody2D>(); trans = transform; Health = MaxHealth; drag = Drag; maxSpeed = Mathf.Max(AccelerationLeft, AccelerationRight, AccelerationFront, AccelerationBack); maxSpeed.AddBuff(drag, "dragCoefficient", BuffData.Operator.Mul, 0); accelerationFront = AccelerationFront; accelerationLeft = AccelerationLeft; accelerationBack = AccelerationBack; accelerationRight = AccelerationRight; SetTarget(Target); SetGuardTarget(GuardTarget); GetComponent <BehaviorTree>()?.SetVariableValue("controller", this); }