fixed particle

This commit is contained in:
Rapandrasmus 2023-08-24 16:39:56 +02:00
parent 54a5c2aaa2
commit b39fb546f5
2 changed files with 11 additions and 17 deletions

View file

@ -2306,7 +2306,7 @@ ParticleSystem:
serializedVersion: 8
lengthInSec: 1
simulationSpeed: 1.2
stopAction: 0
stopAction: 2
cullingMode: 0
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}
@ -2369,7 +2369,7 @@ ParticleSystem:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
moveWithTransform: 1
moveWithTransform: 0
moveWithCustomTransform: {fileID: 0}
scalingMode: 1
randomSeed: 0
@ -11525,7 +11525,7 @@ ParticleSystem:
serializedVersion: 8
lengthInSec: 1
simulationSpeed: 1.2
stopAction: 0
stopAction: 2
cullingMode: 0
ringBufferMode: 0
ringBufferLoopRange: {x: 0, y: 1}
@ -11588,7 +11588,7 @@ ParticleSystem:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
moveWithTransform: 1
moveWithTransform: 0
moveWithCustomTransform: {fileID: 0}
scalingMode: 1
randomSeed: 0
@ -24312,6 +24312,7 @@ MonoBehaviour:
yellowClap: {fileID: 8899231323861109608}
pinkClap: {fileID: 5162462144302245337}
shadowTrans: {fileID: 4357628429498402732}
camMoveTrans: {fileID: 7676047881968251921}
shadowXRange: -0.5
shadowYRange: 0.45
--- !u!1 &7446072329631304920

View file

@ -3,7 +3,6 @@ using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Util;
using Starpelly;
using UnityEngine.UIElements;
namespace HeavenStudio.Games.Scripts_MonkeyWatch
{
@ -16,6 +15,7 @@ namespace HeavenStudio.Games.Scripts_MonkeyWatch
[SerializeField] private ParticleSystem yellowClap;
[SerializeField] private ParticleSystem pinkClap;
[SerializeField] private Transform shadowTrans;
[SerializeField] private Transform camMoveTrans;
[Header("Properties")]
[SerializeField] private float shadowXRange = 2f;
[SerializeField] private float shadowYRange = 1f;
@ -102,18 +102,11 @@ namespace HeavenStudio.Games.Scripts_MonkeyWatch
else
{
playerMonkeyAnim.DoScaledAnimationAsync(big ? "PlayerClapBig" : "PlayerClap", 0.4f);
if (big)
{
pinkClap.transform.eulerAngles = Vector3.zero;
pinkClap.transform.GetChild(0).GetComponent<ParticleSystem>().SetAsyncScaling(0.4f);
pinkClap.PlayScaledAsync(0.4f);
}
else
{
yellowClap.transform.eulerAngles = Vector3.zero;
yellowClap.transform.GetChild(0).GetComponent<ParticleSystem>().SetAsyncScaling(0.4f);
yellowClap.PlayScaledAsync(0.4f);
}
ParticleSystem clapToSpawn = big ? pinkClap : yellowClap;
ParticleSystem spawnedClap = Instantiate(clapToSpawn, camMoveTrans, true);
spawnedClap.transform.eulerAngles = Vector3.zero;
spawnedClap.transform.GetChild(0).GetComponent<ParticleSystem>().SetAsyncScaling(0.4f);
spawnedClap.PlayScaledAsync(0.4f);
}
}
}