|
@@ -74,8 +74,8 @@ public class CombatHeroEntity : ShowBaiscEntity, ITimeLineAnimtion, ITimeLineGet
|
|
|
get { return combatHeroGameObject.transform.forward; }
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- public virtual async CTask<CombatHeroEntity> Init(CombatAIBasic combatAIBasic, CombatHeroInfo combatHeroInfo,
|
|
|
+ public async CTask<CombatHeroEntity> InitForObject(GameObjectPool poolInterface, CombatAIBasic combatAIBasic,
|
|
|
+ CombatHeroInfo combatHeroInfo,
|
|
|
Vector3 pos,
|
|
|
System.Action<CombatHeroEntity> callBack = null, bool isPlayer = false)
|
|
|
{
|
|
@@ -89,14 +89,7 @@ public class CombatHeroEntity : ShowBaiscEntity, ITimeLineAnimtion, ITimeLineGet
|
|
|
|
|
|
CurrCombatHeroInfo = combatHeroInfo.Copy();
|
|
|
MaxCombatHeroInfo = combatHeroInfo.Copy();
|
|
|
- // GameTimeLineParticleFactory
|
|
|
- CombatHeroGameObjectPool poolInterface =
|
|
|
- await GObjectPool.Instance.FetchAsync<CombatHeroGameObjectPool>(modelName + ".prefab", null);
|
|
|
-#if !COMBAT_SERVER
|
|
|
- if (poolInterface == null || poolInterface.own == null)
|
|
|
- {
|
|
|
- return null;
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
poolInterface.own.transform.position = pos;
|
|
|
// if (!IsEnemy)
|
|
@@ -107,7 +100,7 @@ public class CombatHeroEntity : ShowBaiscEntity, ITimeLineAnimtion, ITimeLineGet
|
|
|
// fx_hero_quan.own.transform.localPosition = Vector3.zero;
|
|
|
// }
|
|
|
|
|
|
- poolInterface.own.SetActive(false);
|
|
|
+ // poolInterface.own.SetActive(false);
|
|
|
heroMagicWeaponControl = new MagicWeaponControl();
|
|
|
combatHeroTimeLineControl = new CombatHeroTimeLineControl();
|
|
|
combatHeroTimeLineControl.Init(this);
|
|
@@ -161,7 +154,7 @@ public class CombatHeroEntity : ShowBaiscEntity, ITimeLineAnimtion, ITimeLineGet
|
|
|
// combatHeroAnimtion = new CombatHeroGPUAnimtion();
|
|
|
// }
|
|
|
|
|
|
- poolInterface.own.SetActive(true);
|
|
|
+ // poolInterface.own.SetActive(true);
|
|
|
combatHeroAnimtion.Init(this);
|
|
|
CombatAIBasic.ChangeState(CombatHeroStateType.XiuMian);
|
|
|
if (IsEnemy)
|
|
@@ -174,10 +167,36 @@ public class CombatHeroEntity : ShowBaiscEntity, ITimeLineAnimtion, ITimeLineGet
|
|
|
await heroMagicWeaponControl.InitMagicWeapon(this, isPlayer);
|
|
|
CombatReportManager.Instance.AddCombatReportInfo(this);
|
|
|
callBack?.Invoke(this);
|
|
|
-#endif
|
|
|
+
|
|
|
return this;
|
|
|
}
|
|
|
|
|
|
+ public virtual async CTask<CombatHeroEntity> Init(CombatAIBasic combatAIBasic, CombatHeroInfo combatHeroInfo,
|
|
|
+ Vector3 pos,
|
|
|
+ System.Action<CombatHeroEntity> callBack = null, bool isPlayer = false)
|
|
|
+ {
|
|
|
+ //后面记到检查战斗里面不要出现异步加载,也不要出现同步IO加载
|
|
|
+ this.isPlayer = isPlayer;
|
|
|
+ string modelName = combatHeroInfo.modelName;
|
|
|
+ if (combatHeroInfo.isGpu)
|
|
|
+ {
|
|
|
+ modelName += "_gpu";
|
|
|
+ }
|
|
|
+
|
|
|
+ CurrCombatHeroInfo = combatHeroInfo.Copy();
|
|
|
+ MaxCombatHeroInfo = combatHeroInfo.Copy();
|
|
|
+ // GameTimeLineParticleFactory
|
|
|
+ CombatHeroGameObjectPool poolInterface =
|
|
|
+ await GObjectPool.Instance.FetchAsync<CombatHeroGameObjectPool>(modelName + ".prefab", null);
|
|
|
+
|
|
|
+ if (poolInterface == null || poolInterface.own == null)
|
|
|
+ {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ return await InitForObject(poolInterface, combatAIBasic, combatHeroInfo, pos, callBack, isPlayer);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public virtual void Update(float t)
|
|
|
{
|
|
@@ -368,6 +387,25 @@ public class CombatHeroEntity : ShowBaiscEntity, ITimeLineAnimtion, ITimeLineGet
|
|
|
heroLoopParticle.Clear();
|
|
|
}
|
|
|
|
|
|
+ public void DisposeForOnetCombat()
|
|
|
+ {
|
|
|
+ if (_isDis)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ _isDis = true;
|
|
|
+ BuffControl.Dispose();
|
|
|
+ _isDis = true;
|
|
|
+
|
|
|
+ CombatHeroSkillControl.Dispose();
|
|
|
+ CombatAIBasic.Dispose();
|
|
|
+ combatHeroTimeLineControl.Dispose();
|
|
|
+ combatHeroAnimtion.Dispose();
|
|
|
+ CloseLoopFx();
|
|
|
+ ShieldsBarrier?.Dispose();
|
|
|
+ ShieldsBarrier = null;
|
|
|
+ }
|
|
|
|
|
|
public void Dispose()
|
|
|
{
|
|
@@ -402,6 +440,7 @@ public class CombatHeroEntity : ShowBaiscEntity, ITimeLineAnimtion, ITimeLineGet
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
public override void DormancyObj()
|
|
|
{
|
|
|
Dispose();
|