|
|
|
|
|
|
/// </summary>
|
|
|
|
public IRewardProvider rewardProvider |
|
|
|
{ |
|
|
|
get { return m_RewardProviderComponent.GetRewardProvider(); } |
|
|
|
get |
|
|
|
{ |
|
|
|
Debug.Assert(m_RewardProviderComponent != null, |
|
|
|
nameof(m_RewardProviderComponent) + " != null"); |
|
|
|
return m_RewardProviderComponent.GetRewardProvider(); |
|
|
|
} |
|
|
|
public CumulativeRewardProvider defaultRewardProvider |
|
|
|
CumulativeRewardProvider DefaultRewardProvider |
|
|
|
{ |
|
|
|
get { return rewardProvider as CumulativeRewardProvider; } |
|
|
|
} |
|
|
|
|
|
|
/// </summary>
|
|
|
|
public void ResetReward() |
|
|
|
{ |
|
|
|
Debug.Assert(defaultRewardProvider != null, "the defaultRewardProvider is null and " + |
|
|
|
Debug.Assert(DefaultRewardProvider != null, "the DefaultRewardProvider is null and " + |
|
|
|
defaultRewardProvider.ResetReward(m_Done); |
|
|
|
DefaultRewardProvider.ResetReward(m_Done); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
/// <param name="reward">The new value of the reward.</param>
|
|
|
|
public void SetReward(float reward) |
|
|
|
{ |
|
|
|
Debug.Assert(defaultRewardProvider != null, "the defaultRewardProvider is null and " + |
|
|
|
Debug.Assert(DefaultRewardProvider != null, "the DefaultRewardProvider is null and " + |
|
|
|
defaultRewardProvider.SetReward(reward); |
|
|
|
DefaultRewardProvider.SetReward(reward); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
public void AddReward(float increment) |
|
|
|
{ |
|
|
|
Debug.Assert(defaultRewardProvider != null, "the defaultRewardProvider is null and " + |
|
|
|
Debug.Assert(DefaultRewardProvider != null, "the DefaultRewardProvider is null and " + |
|
|
|
defaultRewardProvider.AddReward(increment); |
|
|
|
DefaultRewardProvider.AddReward(increment); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|