浏览代码

typo fix

/main
Amel Negra 4 年前
当前提交
df409c61
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 2
      UOP1_Project/Assets/Scripts/Characters/Damageable.cs
  2. 10
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/DropRewardSO.cs

2
UOP1_Project/Assets/Scripts/Characters/Damageable.cs


[SerializeField] private GetHitEffectConfigSO _getHitEffectSO;
[SerializeField] private Renderer _mainMeshRenderer;
[SerializeField] private DroppableRewardConfigSO _droppableRewardSO;
public DroppableRewardConfigSO DropableRewardConfig => _droppableRewardSO;
public DroppableRewardConfigSO DroppableRewardConfig => _droppableRewardSO;
private int _currentHealth = default;

10
UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/DropRewardSO.cs


public override void Awake(StateMachine stateMachine)
{
_dropRewardConfig = stateMachine.GetComponent<Damageable>().DropableRewardConfig;
_dropRewardConfig = stateMachine.GetComponent<Damageable>().DroppableRewardConfig;
_currentTransform = stateMachine.transform;
}

DropAllRewards(_currentTransform.position);
}
private void DropAllRewards(Vector3 postion)
private void DropAllRewards(Vector3 position)
{
// Drop items
foreach (DropGroup dropGroup in _dropRewardConfig.DropGroups)

{
DropOneReward(dropGroup, postion);
DropOneReward(dropGroup, position);
}
else
{

}
private void DropOneReward(DropGroup dropGroup, Vector3 postion)
private void DropOneReward(DropGroup dropGroup, Vector3 position)
{
float dropDice = Random.value;
float _currentRate = 0.0f;

float randAngle = Random.value * Mathf.PI * 2;
GameObject collectibleItem = GameObject.Instantiate(itemPrefab,
postion + itemPrefab.transform.localPosition +
position + itemPrefab.transform.localPosition +
_dropRewardConfig.ScatteringDistance * (Mathf.Cos(randAngle) * Vector3.forward + Mathf.Sin(randAngle) * Vector3.right),
Quaternion.identity);
collectibleItem.GetComponent<CollectibleItem>().SetItem(item);
正在加载...
取消
保存