public static LimitedFloat operator -(LimitedFloat argLHS, float argRHS) { LimitedFloat myLimitedFloat = new LimitedFloat(argLHS); myLimitedFloat.Current -= argRHS; return(myLimitedFloat); }
protected override void implementation_setSimulationFromLogic( ISimulatableLogic inLogicToSetFrom) { CarPhysicsLogic theLogicToSetFrom = inLogicToSetFrom as CarPhysicsLogic; if (!theLogicToSetFrom) { //TODO: Make universal though for incorrect type casts throw new Exception("Simulation object has no compitable simulatable logic"); } GameObject theGameObjectToSetFrom = theLogicToSetFrom.gameObject; //Set rigid body var theRigidBodyToSetFrom = theGameObjectToSetFrom.GetComponent <Rigidbody2D>(); _rigidBody.angularVelocity = theRigidBodyToSetFrom.angularVelocity; _rigidBody.velocity = theRigidBodyToSetFrom.velocity; //Set logic state _gasValue = theLogicToSetFrom._gasValue; _isGasWasChangedOnUpdate = theLogicToSetFrom._isGasWasChangedOnUpdate; _steeringWheelValue = theLogicToSetFrom._steeringWheelValue; _isSteeringWheelWasRotatedOnUpdate = theLogicToSetFrom._isSteeringWheelWasRotatedOnUpdate; }
//-Implementation protected void Start() { _ammoInClip = new LimitedFloat(ClipSettings); _stateMachine = new SimpleStateMachine <State>(State.Idle); uiShootController = GetComponent <UIShootController>(); if (uiShootController) { uiShootController.setClipStats( (int)_ammoInClip.getValue(), (int)_ammoInClip.getValue() ); } }
public LimitedFloat(LimitedFloat argCopy) { min = argCopy.Min; max = argCopy.Max; current = argCopy.Current; }
void Reset() { distance = new LimitedFloat(3.0f, 1, 10); height = new LimitedFloat(1.0f, 1, 5); panX = new LimitedFloat(0.0f, -1, 1); panY = new LimitedFloat(0.0f, 0, 2); damping = 5.0f; rotationDamping = 10.0f; Controls.Add(new CameraControl(TargetEnum.Distance, MouseCodeEnum.ScrollWheel, 2)); Controls.Add(new CameraControl(TargetEnum.Height, MouseCodeEnum.ScrollWheel, 1)); Controls.Add(new CameraControl(TargetEnum.PanY, MouseCodeEnum.ScrollWheel, 0.5f)); Controls.Add(new CameraControl(TargetEnum.PanX, KeyCode.LeftArrow, -1)); Controls.Add(new CameraControl(TargetEnum.PanX, KeyCode.RightArrow, 1)); }
public static LimitedFloat operator -(LimitedFloat argLHS, float argRHS) { LimitedFloat myLimitedFloat = new LimitedFloat(argLHS); myLimitedFloat.Current -= argRHS; return myLimitedFloat; }
protected void implementation_initialize_state() { _gasValue = new LimitedFloat(GasValueSettings); _steeringWheelValue = new LimitedFloatAngle(SteeringWheelValueSettings); }
//-Implementation void Awake() { _buildPoints = new LimitedFloat( 0.0f, getBuildingScheme().buildPointsToConstruct ); }
//-Implementation private void Start() { _hitPoints = new LimitedFloat(0.0f, MaxHitPoints, MaxHitPoints); _hitPoints.onAchievedMaximum += () => onAchievedMaxHitPoints?.Invoke(); _hitPoints.onAchievedMinimum += () => onAchievedNoHitPoints?.Invoke(); }