57 lines
1.5 KiB
C#
57 lines
1.5 KiB
C#
using UnityEngine;
|
|
|
|
public class FishJumpAnimFX : MonoBehaviour
|
|
{
|
|
public GameObject ripleFX;
|
|
|
|
public GameObject causticFX;
|
|
|
|
public GameObject splashFX;
|
|
|
|
private FishMovement fishMovement;
|
|
|
|
private ParticleSystem fishFoamSystem;
|
|
|
|
private void Start()
|
|
{
|
|
fishMovement = base.transform.parent.GetComponent<FishMovement>();
|
|
ShowCausticFishFX();
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (fishFoamSystem != null && !(fishMovement.deepProbe.y < 0.5f) && fishFoamSystem.isPlaying)
|
|
{
|
|
fishFoamSystem.Stop();
|
|
}
|
|
}
|
|
|
|
public void StartJumpFishModel()
|
|
{
|
|
fishMovement.fishStats.fishAnimator.SetBool("jump", value: true);
|
|
}
|
|
|
|
public void StopJumpFishModel()
|
|
{
|
|
fishMovement.fishStats.fishAnimator.SetBool("jump", value: false);
|
|
}
|
|
|
|
public void ShowRipleFishFX()
|
|
{
|
|
Object.Instantiate(ripleFX, base.transform.position, Quaternion.identity).transform.localScale = base.transform.parent.localScale * 0.5f;
|
|
}
|
|
|
|
public void ShowSplashFishFX()
|
|
{
|
|
GameObject gameObject = Object.Instantiate(splashFX, base.transform.position, Quaternion.identity);
|
|
gameObject.transform.localScale = base.transform.parent.localScale * 0.17f;
|
|
gameObject.transform.position = new Vector3(gameObject.transform.position.x, fishMovement.deepProbe.z, gameObject.transform.position.z);
|
|
}
|
|
|
|
public void ShowCausticFishFX()
|
|
{
|
|
GameObject gameObject = Object.Instantiate(causticFX, base.transform.position, Quaternion.identity, base.transform.parent);
|
|
fishFoamSystem = gameObject.GetComponent<ParticleSystem>();
|
|
}
|
|
}
|