// Start is called before the first frame update void Start() { CombatEntity = Entity.CreateWithParent <CombatEntity>(CombatContext.Instance); CombatEntity.Position = transform.position; CombatEntity.AddComponent <MotionComponent>(); CombatEntity.ListenActionPoint(ActionPointType.PostReceiveDamage, OnReceiveDamage); CombatEntity.ListenActionPoint(ActionPointType.PostReceiveCure, OnReceiveCure); CombatEntity.ListenActionPoint(ActionPointType.PostReceiveStatus, OnReceiveStatus); CombatEntity.Subscribe <RemoveStatusEvent>(OnRemoveStatus).AsCoroutine(); var config = Resources.Load <StatusConfigObject>("StatusConfigs/Status_Tenacity"); var Status = CombatEntity.AttachStatus <StatusTenacity>(config); Status.Caster = CombatEntity; Status.TryActivateAbility(); }
// Start is called before the first frame update void Start() { CombatEntity = EntityFactory.Create <CombatEntity>(); CombatEntity.ListenActionPoint(ActionPointType.PostReceiveDamage, OnReceiveDamage); CombatEntity.ListenActionPoint(ActionPointType.PostReceiveCure, OnReceiveCure); if (name == "Monster") { CombatEntity.ListenActionPoint(ActionPointType.PostReceiveStatus, ReceiveStatus); CombatEntity.Subscribe <StatusRemoveEvent>(OnStatusRemove).AsCoroutine(); } var config = Resources.Load <StatusConfigObject>("StatusConfigs/Status_Tenacity_坚韧"); var Status = CombatEntity.AttachStatus <StatusTenacity>(config); Status.Caster = CombatEntity; Status.TryActivateAbility(); }