浏览代码

Merge branch 'use-box-collider-for-pottery-objects' of https://github.com/mtakac/open-project-1 into main

/main
Ciro Continisio 4 年前
当前提交
5fcc526a
共有 2 个文件被更改,包括 17 次插入9 次删除
  1. 8
      UOP1_Project/Assets/Prefabs/Props/Pottery.prefab
  2. 18
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/AnimatorParameterActionSO.cs

8
UOP1_Project/Assets/Prefabs/Props/Pottery.prefab


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!135 &3643492659455997558
SphereCollider:
--- !u!65 &6161935898026677332
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}

m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.25
m_Center: {x: 0.000032931566, y: 0.19022962, z: 0.00025852025}
m_Size: {x: 0.45636025, y: 0.38045925, z: 0.4567869}
m_Center: {x: 0, y: 0.19, z: 0}
--- !u!1001 &1827721930691369115
PrefabInstance:
m_ObjectHideFlags: 0

18
UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/AnimatorParameterActionSO.cs


public override void OnStateEnter()
{
if(_whenToRun == SpecificMoment.OnStateEnter)
if (_whenToRun == SpecificMoment.OnStateEnter)
SetParameter();
}

{
switch (_parameterType)
{
case AnimatorParameterActionSO.ParameterType.Bool: _animator.SetBool(_parameterHash, _boolValue); break;
case AnimatorParameterActionSO.ParameterType.Int: _animator.SetInteger(_parameterHash, _intValue); break;
case AnimatorParameterActionSO.ParameterType.Float: _animator.SetFloat(_parameterHash, _floatValue); break;
case AnimatorParameterActionSO.ParameterType.Trigger: _animator.SetTrigger(_parameterHash); break;
case AnimatorParameterActionSO.ParameterType.Bool:
_animator.SetBool(_parameterHash, _boolValue);
break;
case AnimatorParameterActionSO.ParameterType.Int:
_animator.SetInteger(_parameterHash, _intValue);
break;
case AnimatorParameterActionSO.ParameterType.Float:
_animator.SetFloat(_parameterHash, _floatValue);
break;
case AnimatorParameterActionSO.ParameterType.Trigger:
_animator.SetTrigger(_parameterHash);
break;
}
}
正在加载...
取消
保存