123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using Core.Triiger;
- using Fort23.UTool;
- using GameLogic.Combat.CombatTool;
- using GameLogic.Combat.Hero;
- using GameTimeLine.CustomizeTimeLogic;
- using UnityEngine;
- using Utility;
- using UTool.CustomizeTimeLogic.FxLogic.TimeLineEventinterface;
- public class CombatHeroGameObject: IDisposable
- {
- public GameObjectPool GameObjectPool;
- public Transform transform
- {
- get { return GameObjectPool.own.transform; }
- }
- public Vector3 position
- {
- get { return GameObjectPool.own.transform.position; }
- }
- public Quaternion rotation
- {
- get { return GameObjectPool.own.transform.rotation; }
- set { GameObjectPool.own.transform.rotation=value; }
- }
- private CombatHeroEntity _combatHeroEntity;
- private CombatHeroHitPoint _combatHeroHitPoints = new CombatHeroHitPoint();
- public Transform hpTransform;
- public void Init(CombatHeroEntity combatHeroEntity, GameObjectPool gameObjectPool)
- {
- _combatHeroEntity = combatHeroEntity;
- GameObjectPool = gameObjectPool;
- SetGameObject(gameObjectPool);
- }
- public void SetGameObject(GameObjectPool gameObjectPool)
- {
-
- hpTransform = GameObjectPool.own.transform.Find("hp");
- if (hpTransform == null)
- {
- hpTransform = GameObjectPool.own.transform;
- }
- GameObjectPool = gameObjectPool;
- HitPointMono hitPointMonos = GameObjectPool.own.GetComponentInChildren<HitPointMono>(true);
- HitPointMono hitPointMono = hitPointMonos;
- _combatHeroHitPoints = new CombatHeroHitPoint();
- _combatHeroHitPoints.Init(_combatHeroEntity, hitPointMono);
- CombatController.currActiveCombat.CombatHeroController.AddHeroHitPoint(_combatHeroEntity.IsEnemy,_combatHeroHitPoints);
- }
-
- public void HeroDie()
- {
- CombatController.currActiveCombat.CombatHeroController.RemoveHeroHitPoint(_combatHeroEntity.IsEnemy,_combatHeroHitPoints);
- }
- public void SetPosition(Vector3 pos)
- {
- GameObjectPool.own.transform.position = pos;
- }
- public T GetILifetCycleHitPoint<T>(string hitPoinName, bool isStandType, bool isIgnoreHind)
- where T : ILifetCycleHitPoint
- {
- return (T)(object)_combatHeroHitPoints;
- }
- public T GetMainHotPoin<T>(bool isIgnoreHind) where T : ILifetCycleHitPoint
- {
- return (T)(object)_combatHeroHitPoints;
- }
- public void Dispose()
- {
-
- GObjectPool.Instance.Recycle(GameObjectPool);
- }
- }
|