浏览代码

Tweaks to landing particles

/devlogs-3-input
Ciro Continisio 4 年前
当前提交
5efb9eed
共有 6 个文件被更改,包括 24 次插入98 次删除
  1. 75
      UOP1_Project/Assets/Prefabs/Characters/PigChef.prefab
  2. 2
      UOP1_Project/Assets/Prefabs/Effects/DustParticles/JumpParticle.prefab
  3. 8
      UOP1_Project/Assets/Prefabs/Effects/DustParticles/LandingParticle.prefab
  4. 22
      UOP1_Project/Assets/Prefabs/Effects/DustParticles/WalkingParticle.prefab
  5. 7
      UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/PlayLandParticlesActionSO.cs
  6. 8
      UOP1_Project/Assets/Scripts/Effects/DustParticlesController.cs

75
UOP1_Project/Assets/Prefabs/Characters/PigChef.prefab


propertyPath: m_Name
value: WalkingParticle
objectReference: {fileID: 0}
- target: {fileID: 8368940308521127494, guid: f8a6e96eef53e5a4686f9a85a72fe73b,
type: 3}
propertyPath: InitialModule.startSize.scalar
value: 0.07
objectReference: {fileID: 0}
- target: {fileID: 8368940308521127494, guid: f8a6e96eef53e5a4686f9a85a72fe73b,
type: 3}
propertyPath: InitialModule.startSize.minScalar
value: 0.02
objectReference: {fileID: 0}
- target: {fileID: 8368940308521127494, guid: f8a6e96eef53e5a4686f9a85a72fe73b,
type: 3}
propertyPath: InitialModule.gravityModifier.scalar
value: -0.2
objectReference: {fileID: 0}
- target: {fileID: 8368940308521127494, guid: f8a6e96eef53e5a4686f9a85a72fe73b,
type: 3}
propertyPath: ShapeModule.type
value: 12
objectReference: {fileID: 0}
- target: {fileID: 8368940308521127494, guid: f8a6e96eef53e5a4686f9a85a72fe73b,
type: 3}
propertyPath: ShapeModule.radius.value
value: 0.14
objectReference: {fileID: 0}
- target: {fileID: 8368940308521127494, guid: f8a6e96eef53e5a4686f9a85a72fe73b,
type: 3}
propertyPath: EmissionModule.rateOverTime.minMaxState
value: 3
objectReference: {fileID: 0}
- target: {fileID: 8368940308521127494, guid: f8a6e96eef53e5a4686f9a85a72fe73b,
type: 3}
propertyPath: EmissionModule.rateOverTime.minScalar
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8368940308521127494, guid: f8a6e96eef53e5a4686f9a85a72fe73b,
type: 3}
propertyPath: EmissionModule.rateOverDistance.minMaxState
value: 3
objectReference: {fileID: 0}
- target: {fileID: 8368940308521127494, guid: f8a6e96eef53e5a4686f9a85a72fe73b,
type: 3}
propertyPath: EmissionModule.m_Bursts.Array.data[0].cycleCount
value: 3
objectReference: {fileID: 0}
- target: {fileID: 8368940308521127494, guid: f8a6e96eef53e5a4686f9a85a72fe73b,
type: 3}
propertyPath: EmissionModule.m_Bursts.Array.data[0].repeatInterval
value: 0.1
objectReference: {fileID: 0}
- target: {fileID: 8368940308521127494, guid: f8a6e96eef53e5a4686f9a85a72fe73b,
type: 3}
propertyPath: EmissionModule.m_Bursts.Array.data[0].probability
value: 0.7
objectReference: {fileID: 0}
- target: {fileID: 8368940308521127494, guid: f8a6e96eef53e5a4686f9a85a72fe73b,
type: 3}
propertyPath: ShapeModule.radiusThickness
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f8a6e96eef53e5a4686f9a85a72fe73b, type: 3}
--- !u!198 &4559447277278735044 stripped

type: 3}
propertyPath: m_Name
value: LandingParticle
objectReference: {fileID: 0}
- target: {fileID: 8442424470799517435, guid: 2a17d00f8cddbf44ea0f55e00cbc97e9,
type: 3}
propertyPath: InitialModule.startSize.scalar
value: 0.2
objectReference: {fileID: 0}
- target: {fileID: 8442424470799517435, guid: 2a17d00f8cddbf44ea0f55e00cbc97e9,
type: 3}
propertyPath: InitialModule.startSize.minScalar
value: 0.03
objectReference: {fileID: 0}
- target: {fileID: 8442424470799517435, guid: 2a17d00f8cddbf44ea0f55e00cbc97e9,
type: 3}
propertyPath: EmissionModule.m_Bursts.Array.data[0].countCurve.scalar
value: 7
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 2a17d00f8cddbf44ea0f55e00cbc97e9, type: 3}

2
UOP1_Project/Assets/Prefabs/Effects/DustParticles/JumpParticle.prefab


startSize:
serializedVersion: 2
minMaxState: 1
scalar: 0.16
scalar: 0.06
minScalar: 0.16
maxCurve:
serializedVersion: 2

8
UOP1_Project/Assets/Prefabs/Effects/DustParticles/LandingParticle.prefab


- component: {fileID: 8442424470799517435}
- component: {fileID: 8525369151793231701}
m_Layer: 0
m_Name: LandingPuffParticle
m_Name: LandingParticle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

startSize:
serializedVersion: 2
minMaxState: 3
scalar: 0.12
minScalar: 0.04
scalar: 0.2
minScalar: 0.03
maxCurve:
serializedVersion: 2
m_Curve:

countCurve:
serializedVersion: 2
minMaxState: 0
scalar: 10
scalar: 7
minScalar: 30
maxCurve:
serializedVersion: 2

22
UOP1_Project/Assets/Prefabs/Effects/DustParticles/WalkingParticle.prefab


startSize:
serializedVersion: 2
minMaxState: 3
scalar: 0.09
minScalar: 0.05
scalar: 0.07
minScalar: 0.02
maxCurve:
serializedVersion: 2
m_Curve:

gravityModifier:
serializedVersion: 2
minMaxState: 0
scalar: 0
scalar: -0.2
minScalar: 0
maxCurve:
serializedVersion: 2

ShapeModule:
serializedVersion: 6
enabled: 1
type: 0
type: 12
angle: 25
length: 5
boxThickness: {x: 0, y: 0, z: 0}

sphericalDirectionAmount: 1
randomPositionAmount: 0
radius:
value: 0.07
value: 0.14
mode: 0
spread: 0
speed:

serializedVersion: 4
rateOverTime:
serializedVersion: 2
minMaxState: 0
minMaxState: 3
minScalar: 10
minScalar: 0
maxCurve:
serializedVersion: 2
m_Curve:

m_RotationOrder: 4
rateOverDistance:
serializedVersion: 2
minMaxState: 0
minMaxState: 3
scalar: 0
minScalar: 0
maxCurve:

m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
cycleCount: 1
repeatInterval: 1
probability: 1
cycleCount: 3
repeatInterval: 0.1
probability: 0.7
SizeModule:
enabled: 1
curve:

7
UOP1_Project/Assets/Scripts/Characters/StateMachine/Actions/PlayLandParticlesActionSO.cs


private float _coolDown = 0.3f;
private float t = 0f;
private float _fallStartY = 0;
private float _fallEndY = 0;
private float _maxFallDistance = 4; //Used to adjust particle emission intensity
private float _fallStartY = 0f;
private float _fallEndY = 0f;
private float _maxFallDistance = 4f; //Used to adjust particle emission intensity
public override void Awake(StateMachine stateMachine)
{

if (Time.time >= t + _coolDown)
{
//_dustController.PlayLandParticles();
_dustController.PlayLandParticles(fallIntensity);
t = Time.time;
}

8
UOP1_Project/Assets/Scripts/Effects/DustParticlesController.cs


// make sure intensity is always between 0 and 1
intensity = Mathf.Clamp01(intensity);
var main = _landParticles.main;
var origCurve = main.startSize; //save original curve to be assigned back to particle system
ParticleSystem.MainModule main = _landParticles.main;
ParticleSystem.MinMaxCurve origCurve = main.startSize; //save original curve to be assigned back to particle system
ParticleSystem.MinMaxCurve newCurve = main.startSize; //Make a new minMax curve and make our changes to the new copy
float minSize = newCurve.constantMin;

// Put the original startSize back where you found it
StartCoroutine(ResetMinMaxCurve(_landParticles, origCurve));
// Note: We don't necessarily need to reset the curve, as it will be overridden
}
private IEnumerator ResetMinMaxCurve(ParticleSystem ps, ParticleSystem.MinMaxCurve curve)

yield return null;
}
var main = ps.main;
ParticleSystem.MainModule main = ps.main;
main.startSize = curve;
}
}
正在加载...
取消
保存