1
This commit is contained in:
@@ -191,12 +191,38 @@ public class MonsterContral : MonoBehaviour
|
||||
|
||||
break;
|
||||
case "702":
|
||||
case "710":
|
||||
moveTime += Time.deltaTime;
|
||||
{
|
||||
Vector2 v2 = monsterData.moveLine.GetBezierPoint(moveTime);
|
||||
if ((FishTypeEnum)monsterData.fishTypeConfig.fishType != FishTypeEnum.Boss鱼)
|
||||
{
|
||||
transform.up = ((Vector2)transform.position - v2).normalized;
|
||||
switch (forwordXYZ)
|
||||
{
|
||||
case "X":
|
||||
transform.right = (v2 - (Vector2)transform.position).normalized;
|
||||
break;
|
||||
case "Y":
|
||||
transform.up = (v2 - (Vector2)transform.position).normalized;
|
||||
break;
|
||||
case "Z":
|
||||
transform.forward = (v2 - (Vector2)transform.position).normalized;
|
||||
break;
|
||||
case "-X":
|
||||
transform.right = ((Vector2)transform.position - v2).normalized;
|
||||
break;
|
||||
case "-Y":
|
||||
transform.up = ((Vector2)transform.position - v2).normalized;
|
||||
break;
|
||||
case "-Z":
|
||||
transform.forward = ((Vector2)transform.position - v2).normalized;
|
||||
break;
|
||||
|
||||
default:
|
||||
transform.up = ((Vector2)transform.position - v2).normalized;
|
||||
break;
|
||||
}
|
||||
//transform.up = ((Vector2)transform.position - v2).normalized;
|
||||
}
|
||||
transform.position = v2;
|
||||
}
|
||||
|
||||
@@ -1,17 +1,70 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using UnityEngine.ResourceManagement.AsyncOperations;
|
||||
using static MonsterMoveLine;
|
||||
|
||||
public class MonsterControl_BossBase : MonsterContral
|
||||
{
|
||||
public string bossName;
|
||||
public override void Init(string pathId, float Time, bool isyuzhen = false, string yzID = "")
|
||||
public async override void Init(string pathId, float Time, bool isyuzhen = false, string yzID = "")
|
||||
{
|
||||
BezierCurveData bezierCurveData = MonsterMoveLine.dic_BezierCurveDatas[bossName + pathId];
|
||||
monsterData.moveLine.Init(bezierCurveData, Time);
|
||||
isyz = isyuzhen;
|
||||
this.yzID = yzID;
|
||||
Destroy(gameObject, Time);
|
||||
switch (GameManager.Instance.gameData.currGameType)
|
||||
{
|
||||
case GameType.JQQD:
|
||||
break;
|
||||
case GameType.defaultPanel:
|
||||
break;
|
||||
case GameType.FLZY:
|
||||
{
|
||||
AsyncOperationHandle < Sprite > handle = Addressables.LoadAssetAsync<Sprite>("Assets/Art/XJMH/pw/pw_sprite/handbook/"+ bossName + ".png");
|
||||
await handle.Task;
|
||||
Sprite sprite = handle.Result;
|
||||
UIManager.Instance.Get<GameMainPanel_FLZY>(UIPanel.MainGamePanelFLZY).subUIManager.ShowBoardBoss(sprite, bossName);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
case GameType.TGXX:
|
||||
//还没有写呢
|
||||
{
|
||||
AsyncOperationHandle<Sprite> handle = Addressables.LoadAssetAsync<Sprite>("Assets/Art/XJMH/pw/pw_sprite/handbook/" + bossName + ".png");
|
||||
await handle.Task;
|
||||
Sprite sprite = handle.Result;
|
||||
UIManager.Instance.Get<GameMainPanel_FLZY>(UIPanel.MainGamePanelFLZY).subUIManager.ShowBoardBoss(sprite, bossName);
|
||||
|
||||
}
|
||||
break;
|
||||
case GameType.ZGXQ:
|
||||
|
||||
break;
|
||||
case GameType.XJMH:
|
||||
{
|
||||
AsyncOperationHandle<Sprite> handle = Addressables.LoadAssetAsync<Sprite>("Assets/Art/XJMH/pw/pw_sprite/handbook/" + bossName + ".png");
|
||||
await handle.Task;
|
||||
Sprite sprite = handle.Result;
|
||||
UIManager.Instance.Get<GameMainPanel_XJMH>(UIPanel.MainGamePanelXJMH).subUIManager.ShowBoardBoss(sprite, bossName);
|
||||
|
||||
}
|
||||
break;
|
||||
case GameType.HHWK:
|
||||
{
|
||||
AsyncOperationHandle<Sprite> handle = Addressables.LoadAssetAsync<Sprite>("Assets/Art/XJMH/pw/pw_sprite/handbook/" + bossName + ".png");
|
||||
await handle.Task;
|
||||
Sprite sprite = handle.Result;
|
||||
UIManager.Instance.Get<GameMainPanel_HHWK>(UIPanel.MainGamePanelHHWK).subUIManager.ShowBoardBoss(sprite, bossName);
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Characters.Monster
|
||||
{
|
||||
public partial class MonsterDieList : MonoSingleton<MonsterDieList>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9235ca9adf1e6ab4f89a13d5579b51cf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -78,7 +78,10 @@ public class MonsterMoveLine
|
||||
/// <returns></returns>
|
||||
public static async Task LoadBezierTxtAsync(string path)
|
||||
{
|
||||
AsyncOperationHandle<IList<TextAsset>> handles = Addressables.LoadAssetsAsync<TextAsset>(path,null);
|
||||
List<string> keys=new List<string>();
|
||||
keys.Add(path);
|
||||
keys.Add(GameManager.Instance.gameData.currGameType.ToString());
|
||||
AsyncOperationHandle<IList<TextAsset>> handles = Addressables.LoadAssetsAsync<TextAsset>(keys, null,Addressables.MergeMode.Intersection);
|
||||
await handles.Task;
|
||||
foreach (var text in handles.Result)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 38b73c2f9a2551643b5c3badb09598c4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,68 @@
|
||||
using Spine.Unity;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.MyGame.Scripts.Characters.Monster
|
||||
{
|
||||
public partial class MonsterDieList
|
||||
{
|
||||
public GameObject HuangYiHuang;
|
||||
public void SmallHuangYiHuang(Vector3 vector3,string fishid,int gold)
|
||||
{
|
||||
if (FishResourcesData.GetFishDieSpine(int.Parse(fishid))!=null)
|
||||
{
|
||||
GameObject obj = Instantiate(HuangYiHuang, Vector3.one*999, Quaternion.identity,UIManager.Instance.uiRoot);
|
||||
//obj.GetComponent<RectTransform>().anchoredPosition = CoordinateTransformation.WorldToUI(UIManager.Instance.uiRoot.GetComponent<Canvas>(),Camera.main,vector3);
|
||||
obj.GetComponent<RectTransform>().anchoredPosition = CoordinateTransformation.WorldPos_ToCanvas(vector3,UIManager.Instance.uiRoot.GetComponent<Canvas>());
|
||||
var data = obj.transform.GetChild(1).GetComponent<SkeletonGraphic>();
|
||||
data.skeletonDataAsset = FishResourcesData.GetFishDieSpine(int.Parse(fishid));
|
||||
data.Initialize(true);
|
||||
StartCoroutine(YaoYiYao(data.gameObject));
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("spine为空");
|
||||
}
|
||||
}
|
||||
private IEnumerator YaoYiYao(GameObject obj)
|
||||
{
|
||||
|
||||
float timeTemp = 0;
|
||||
float JieShu = 3;
|
||||
while (true)
|
||||
{
|
||||
yield return null;
|
||||
timeTemp += Time.deltaTime;
|
||||
JieShu-= Time.deltaTime;
|
||||
if (JieShu<=0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if (timeTemp <= 0.3f)
|
||||
{
|
||||
obj.transform.rotation = Quaternion.Lerp(obj.transform.rotation, Quaternion.Euler(-Vector3.forward * 30), 0.01f);
|
||||
}
|
||||
//else if (timeTemp <= 0.6f)
|
||||
//{
|
||||
// obj.transform.rotation = Quaternion.Lerp(obj.transform.rotation, Quaternion.Euler(Vector3.zero), 0.05f);
|
||||
|
||||
//}
|
||||
else if (timeTemp <= 0.6f)
|
||||
{
|
||||
obj.transform.rotation = Quaternion.Lerp(obj.transform.rotation, Quaternion.Euler(Vector3.forward * 30), 0.01f);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
timeTemp = 0;
|
||||
}
|
||||
}
|
||||
Destroy(obj.transform.parent.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 19e4725a7468ce241ab0f361a414500b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class XYZPControl_Boss : MonsterControl_BossBase
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 34479c222411f2e47bceb006ecb80f12
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user