1
This commit is contained in:
@@ -3,14 +3,19 @@ using Assets.MyGame.Scripts.Net.API;
|
||||
using Assets.MyGame.Scripts.Net.APIResponses.Enum;
|
||||
using Assets.MyGame.Scripts.Net.WebResponses;
|
||||
using Newtonsoft.Json;
|
||||
using Spine.Unity;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.InputSystem;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
using static UnityEngine.AddressableAssets.Addressables;
|
||||
|
||||
public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
{
|
||||
@@ -25,7 +30,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
public Button btn_SettingList;
|
||||
|
||||
[Header("我在这")]
|
||||
public Animator mySitAnim;
|
||||
public GameObject mySitAnim;
|
||||
[Header("Skill")]
|
||||
public Dictionary<string, Toggle> dic_Skill_Toggle = new Dictionary<string, Toggle>();//开关型技能
|
||||
|
||||
@@ -45,15 +50,30 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
bool isChangingTurret = false;
|
||||
|
||||
int bulletCount = 0;
|
||||
[Header("")]
|
||||
public GameObject boardCast_Boss;
|
||||
|
||||
public override void Awake()
|
||||
AudioClip bulletClip;
|
||||
|
||||
public async override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
EventCenter.Instance.AddEventListener<SyncGameData>(ConstEventString.SyncGameData_Rotate, SyncGameData_Rotate);
|
||||
EventCenter.Instance.AddEventListener<SyncGameData>(ConstEventString.SyncGameData_FireBullet, SyncGameData_FireBullit);
|
||||
EventCenter.Instance.AddEventListener<SyncGameData>(ConstEventString.SyncGameData_ChangeTargetMonster, SyncGameData_ChangeTargetMonster);
|
||||
subUIManager.boardCast_Boss = boardCast_Boss;
|
||||
FishResourcesData.LoadFishAssetsData();
|
||||
MonsterMoveLine.LoadBezier();//初始化加载路线
|
||||
AudioResourcesData.LoadAudioGame();
|
||||
await Addressables.LoadAssetsAsync<AudioClip>("Audio", clip =>
|
||||
{
|
||||
Debug.Log("clipName" + clip.name);
|
||||
|
||||
if (clip.name == "PW_Shoot")
|
||||
{
|
||||
bulletClip = clip;
|
||||
}
|
||||
}).Task;
|
||||
|
||||
}
|
||||
public virtual void OnDestroy()
|
||||
{
|
||||
@@ -121,6 +141,11 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
if (Touchscreen.current.primaryTouch.press.wasPressedThisFrame)
|
||||
{
|
||||
clickTime = attackTime;
|
||||
if (mySitAnim.gameObject.activeSelf)
|
||||
{
|
||||
|
||||
mySitAnim.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
#region 换炮台
|
||||
//Change Turret
|
||||
@@ -611,7 +636,7 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
list_Sits[syncGameData.sitPos].isLock = true;
|
||||
}
|
||||
}
|
||||
private void FireBullit(SitPosData sitPosData, float angle, bool isSanShe, bool auto, bool isSuoDing, bool twoRTruuect, bool isSelf = true)
|
||||
private async Task FireBullit(SitPosData sitPosData, float angle, bool isSanShe, bool auto, bool isSuoDing, bool twoRTruuect, bool isSelf = true)
|
||||
{
|
||||
|
||||
|
||||
@@ -647,6 +672,8 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
}
|
||||
}
|
||||
|
||||
AudioManager.Instance.PlayFX(bulletClip);
|
||||
|
||||
|
||||
}
|
||||
public string turretAttack;
|
||||
@@ -703,11 +730,12 @@ public class GameMainPanel_FishBase : GameMainPanel_Base
|
||||
//currSitData.ChangeTurret(1);
|
||||
currSitData.lockFX.transform.GetChild(0).gameObject.SetActive(false);
|
||||
currSitData.lockFX.transform.GetChild(1).gameObject.SetActive(true);
|
||||
mySitAnim.GetComponent<RectTransform>().anchoredPosition = currSitData.GetComponent<RectTransform>().anchoredPosition;
|
||||
}
|
||||
else
|
||||
{
|
||||
JoinGame(roomJoinNotice.position, roomJoinNotice.gold, roomJoinNotice.cannonMultiple, 0, roomJoinNotice.userId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user