105 lines
3.8 KiB
C#
105 lines
3.8 KiB
C#
using asap.core;
|
|
using DG.Tweening;
|
|
using UnityEngine;
|
|
using System.Collections;
|
|
public partial class FishingBehaviorB : MonoBehaviour
|
|
{
|
|
void OnStartEternalDeath()
|
|
{
|
|
SetFfishWeight();
|
|
fishingData.IsCatchingFish = true;
|
|
|
|
if (fx_fishing_splashwaveloop != null)
|
|
{
|
|
fx_fishing_splashwaveloop.SetActive(false);
|
|
}
|
|
if (fx_fishing_splashloop != null)
|
|
{
|
|
fx_fishing_splashloop.SetActive(false);
|
|
}
|
|
fishAnimator.speed = 1;
|
|
|
|
fishAnimator.SetBool("_drawing01", false);
|
|
fishAnimator.SetBool("_drawing02", false);
|
|
fishAnimator.SetBool("_drawing", false);
|
|
fishAnimator.SetBool("_idle", false);
|
|
SetPulling();
|
|
GContext.Publish(ERightState.PiercingSp);
|
|
_targetPos = new Vector3(0, -3, fishingBehaviorConf.piercingFishmMoveZ);
|
|
_fish.transform.position = _targetPos;
|
|
_fish.transform.DOKill();
|
|
//CloseIK(true);
|
|
_fish.transform.localRotation = Quaternion.identity;
|
|
|
|
_cameraAnimator.SetBool("_claim", false);
|
|
GContext.Publish(new PlayNewItemFxEvent() { type = 1 });
|
|
if (FishBehaviour != null)
|
|
{
|
|
FishBehaviour.FishAnimSpeed = 1;
|
|
//ReelingScale 鱼缩放
|
|
Vector3 localScale = FishBehaviour.transform.localScale * fishingData.curFishData.PullingScale;
|
|
FishBehaviour.transform.DOScale(localScale, fishingBehaviorConf.jumpScaleTime).OnUpdate
|
|
(
|
|
() =>
|
|
{
|
|
if (FishBehaviour.mouthPos != null)
|
|
{
|
|
Vector3 vector3 = Vector3.zero;
|
|
vector3 = -FishBehaviour.animator.transform.InverseTransformPoint(FishBehaviour.mouthPos.position);
|
|
vector3.z = -vector3.z;
|
|
FishBehaviour.animator.transform.localPosition = vector3;
|
|
}
|
|
}
|
|
);
|
|
|
|
if (!string.IsNullOrEmpty(fishingData.curFishData.FxWaterDrop))
|
|
{
|
|
FxWaterDrop(fishingData.curFishData.FxWaterDrop);
|
|
}
|
|
|
|
MaterialChange();
|
|
}
|
|
|
|
|
|
if (fishingData.IsEventGameFish())
|
|
{
|
|
StartCoroutine(HideLine());
|
|
FishBehaviour.Pulling();
|
|
}
|
|
StartCoroutine(DeathTimeScale());
|
|
StartCoroutine(ControlFishOutWater());
|
|
StartCoroutine(ChangeSpline());
|
|
StartCoroutine(PlayPullingSound());
|
|
if (fx_fishing_splashloop != null)
|
|
{
|
|
fx_fishing_splashloop.SetActive(false);
|
|
}
|
|
LoadEffect("fx_fishing_splashpull");
|
|
|
|
rodHandleAni.SetTrigger("_piercingSp");
|
|
_cameraAnimator.SetTrigger("_piercingSp");
|
|
fishingRodAnimator.SetTrigger("_piercingSp");
|
|
fishAnimator.SetTrigger("_pullingSp");
|
|
FishingPanel_Advanced.Instance?.ShowRankInfo();
|
|
if (!string.IsNullOrEmpty(fishingData.curFishData.FxWaterSplash))
|
|
GContext.Publish(new PlayerRaindropEvent() { FxWaterSplash = fishingData.curFishData.FxWaterSplash });
|
|
GContext.Publish(new VibrationData(21));
|
|
}
|
|
IEnumerator DeathTimeScale()
|
|
{
|
|
yield return new WaitForSeconds(fishingBehaviorConf.timeStartScale);
|
|
DOTween.To(() => 0.01f, x => Time.timeScale = x, 1,
|
|
fishingBehaviorConf.timeEndScale - fishingBehaviorConf.timeStartScale)
|
|
.SetEase(fishingBehaviorConf.piercingSpTimeScaleCurve);
|
|
yield return new WaitForSeconds(fishingBehaviorConf.timeEndScale);
|
|
Time.timeScale = 1f;
|
|
}
|
|
|
|
IEnumerator ChangeSpline()
|
|
{
|
|
yield return new WaitForSeconds(fishingBehaviorConf.fishingRodDisappearsPullingSp);
|
|
SetEffectActive("fx_fishing_splashloopreeling", false);
|
|
ChangelineStartPos();
|
|
}
|
|
}
|