萌妖技能

This commit is contained in:
wulongxiao 2024-12-24 15:38:28 +08:00
parent dc0c8b9538
commit 63134db4eb
6 changed files with 95 additions and 19 deletions

View File

@ -841,7 +841,7 @@ Transform:
- {fileID: 995271151}
- {fileID: 1932457213}
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &284432671
MonoBehaviour:
@ -1540,6 +1540,37 @@ Transform:
m_CorrespondingSourceObject: {fileID: 924676270184311531, guid: 8d398c914061e5842b409729ac3d43c1, type: 3}
m_PrefabInstance: {fileID: 457244935}
m_PrefabAsset: {fileID: 0}
--- !u!1 &459650024
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 459650025}
m_Layer: 0
m_Name: ------------------------------ (3)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &459650025
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 459650024}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &530562778
GameObject:
m_ObjectHideFlags: 0
@ -4333,7 +4364,7 @@ GameObject:
- component: {fileID: 1337722729}
- component: {fileID: 1337722730}
m_Layer: 0
m_Name: ------------------------------
m_Name: ReadJson
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -4352,7 +4383,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1337722730
MonoBehaviour:
@ -6049,6 +6080,37 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1942153352}
m_CullTransparentMesh: 1
--- !u!1 &1993700582
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1993700584}
m_Layer: 0
m_Name: ------------------------------ (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1993700584
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1993700582}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2035101380
GameObject:
m_ObjectHideFlags: 0

View File

@ -29,7 +29,7 @@ public class SkillBox : Base
public Image ExpFill;
public Dictionary<string,Role> mengyaoRole=new Dictionary<string,Role>();
public int ExpNumber
{
@ -43,7 +43,9 @@ public class SkillBox : Base
private int ExpFileObjNumber=0;
[Header("Õ½»ê(¾­Ñé)Ìî³ä¸¸½Úµã")] public GameObject ExpFilePrante;
public List<GameObject> expList = new List<GameObject>();
public List<GameObject> expList = new List<GameObject>();
private void Start()
{
ExpFill.fillAmount = 0;
@ -52,7 +54,6 @@ public class SkillBox : Base
instance = this;
InitSkil();
}
public void UpdataExp(int number)
@ -89,21 +90,22 @@ public class SkillBox : Base
void InitSkil()
{
foreach (string _mengyaoRoleId in mengyaoRole.Keys)
foreach (string _mengyaoRoleId in Base.GlobalObj.GetComponent<gameGlobal>().CarryCardId)
{
foreach (Monster m in MengyaoInfo.Instance.m_SkillData)
foreach (Monster info in MengyaoInfo.Instance.m_SkillData)
{
if (m.temp_id == _mengyaoRoleId)
{
if (string.Equals(_mengyaoRoleId, info.temp_id))
{
for (int j = 0; j < 2; j++)
{
GameObject obj = Instantiate(Skill, SkillParent);
obj.GetComponent<Skill_Spend>().infobox_skill_up = infobox_skill;
//obj.GetComponent<Skill_Spend>().infobox_skill_up = infobox_skill;
obj.GetComponent<Skill_Spend>().MySkill = info.skills[j];
obj.GetComponent<Skill_Spend>().mengyao = MengyaoInfo.Instance.mengyaoIdToRole[info.temp_id];
}
}
return;
break;
}
}
}
}
@ -192,7 +194,7 @@ public class SkillBox : Base
void OnDestroy()
{
mengyaoRole = null;
//mengyaoRole = null;
}
}

View File

@ -38,6 +38,9 @@ public class Skill_Spend : MonoBehaviour
public Skill MySkill = new Skill();
//[HideInInspector]
public GameObject mengyao;//对应的role
// Start is called before the first frame update
void Start()
{

View File

@ -33,6 +33,10 @@ public class cardBox : MonoBehaviour
// ID到萌妖卡预制体的映射字典
private Dictionary<string, GameObject> IDTomangyaoPrefab = new Dictionary<string, GameObject>();
//public Dictionary<string,>
[HideInInspector] public List<GameObject> card = new List<GameObject>();
private void Awake()
{

View File

@ -81,8 +81,9 @@ public class cardContorl : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndD
if (mY.GetComponent<cardPlace>().isInTrigger)
{
mY.transform.position = mY.GetComponent<cardPlace>().tower.transform.position;
///SkillBox.instance.mengyaoRole.Add(mY.GetComponent<Role>().id,mY.GetComponent<Role>());
MengyaoInfo.Instance.mengyaoIdToRole.Add(mY.GetComponent<Role>().id, mY);
this.enabled = false;
cardBox.instance.ChangeInPlaceNumber(1);

View File

@ -2,6 +2,7 @@ using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Xml.Linq;
using Unity.VisualScripting;
using UnityEngine;
public class MengyaoInfo :JsonReadBase
@ -16,6 +17,9 @@ public class MengyaoInfo :JsonReadBase
public List<WaveData> m_WaveData;
public List<Monster> m_SkillData;
public static MengyaoInfo Instance;
public Dictionary<string,GameObject> mengyaoIdToRole=new Dictionary<string, GameObject>();
// Start is called before the first frame update
void Awake()
{
@ -35,11 +39,11 @@ public class MengyaoInfo :JsonReadBase
//base.DisplayData<Monster>(m_SkillData);
}
// Update is called once per frame
void Update()
void OnDestroy()
{
mengyaoIdToRole=null;
}
}
public class Character