void Awake() { m_PlayerMovementComponentToDisplay = Utils.FindComponentMatchingWithTag <PlayerMovementComponent>(m_Target.ToString()); m_PlayerAttackComponentToDisplay = Utils.FindComponentMatchingWithTag <PlayerAttackComponent>(m_Target.ToString()); m_PlayerInfoComponentToDisplay = Utils.FindComponentMatchingWithTag <PlayerInfoComponent>(m_Target.ToString()); m_DebugSettings = ScenesConfig.GetDebugSettings(); m_GameInputList.SetActive(m_DebugSettings.m_DisplayInputsInfo); m_TriggeredInputs = new List <List <GameInput> >(m_GameInputList.transform.childCount); m_GameInputsImage = new List <List <Image> >(m_GameInputList.transform.childCount); for (int i = 0; i < m_GameInputList.transform.childCount; i++) { List <Image> gameInputImageList = new List <Image>(); Transform gameInputs = m_GameInputList.transform.GetChild(i); for (int j = 0; j < gameInputs.childCount; j++) { Image gameInputImage = gameInputs.GetChild(j).GetComponent <Image>(); gameInputImage.sprite = null; gameInputImage.enabled = false; gameInputImageList.Add(gameInputImage); } m_GameInputsImage.Add(gameInputImageList); } #if !UNITY_EDITOR m_TextInputs.enabled = false; m_TextToDisplayInputs.enabled = false; m_TextInputsAttack.enabled = false; m_TextToDisplayInputsAttack.enabled = false; m_TextAttacks.enabled = false; m_TextToDisplayAttacks.enabled = false; #endif }
public override void OnInit(PlayerAttackComponent playerAttackComponent, PlayerAttack attack) { base.OnInit(playerAttackComponent, attack); m_Rigidbody = playerAttackComponent.m_MovementComponent.m_Controller.m_Rigidbody2D; Utils.GetPlayerEventManager(m_Owner).StartListening(EPlayerEvent.ProjectileSpawned, OnProjectileSpawned); Utils.GetPlayerEventManager(m_Owner).StartListening(EPlayerEvent.ProjectileDestroyed, OnProjectileDestroyed); }
public virtual void OnInit(PlayerAttackComponent playerAttackComponent, PlayerAttack attack) { m_Owner = playerAttackComponent.gameObject; m_Attack = attack; m_Animator = playerAttackComponent.m_Animator; m_MovementComponent = playerAttackComponent.m_MovementComponent; m_AttackComponent = playerAttackComponent; m_InfoComponent = playerAttackComponent.m_InfoComponent; m_AudioManager = playerAttackComponent.m_AudioManager; }
public override void OnInit(PlayerAttackComponent playerAttackComponent, PlayerAttack attack) { base.OnInit(playerAttackComponent, attack); bool triggerAlwaysActive = m_InfoComponent.GetPlayerSettings().TriggerPointAlwaysActive; SetTriggerPointStatus(m_InfoComponent, (triggerAlwaysActive) ? ETriggerPointStatus.Active : ETriggerPointStatus.Inactive); m_InfoComponent.GetPlayerSettings().OnTriggerPointAlwaysActiveChanged += OnTriggerPointAlwaysActiveChanged; }
private void InitComboCounterSubComponent() { if (m_PlayerComboCounterSC == null && m_RegisteredPlayer != null) { PlayerAttackComponent playerAttackComponent = m_RegisteredPlayer.GetComponent <PlayerAttackComponent>(); if (playerAttackComponent != null) { m_PlayerComboCounterSC = playerAttackComponent.GetComboCounterSubComponent(); m_PlayerComboCounterSC.OnHitCounterChanged += OnHitCounterChanged; } } }
private void Update() { if (m_PlayerSuperGaugeSC == null) { PlayerAttackComponent playerAttackComponent = GameManager.Instance.GetPlayerComponent <PlayerAttackComponent>(m_Target); if (playerAttackComponent != null) { m_PlayerSuperGaugeSC = playerAttackComponent.GetSuperGaugeSubComponent(); m_PlayerSuperGaugeSC.OnGaugeValueChanged += OnGaugeValueChanged; OnGaugeValueChanged(); } } }
public override void OnInit(PlayerAttackComponent playerAttackComponent, PlayerAttack attack) { base.OnInit(playerAttackComponent, attack); m_ProjectileHook = m_Owner.transform.Find("Model/" + K_PROJECTILE_HOOK); m_CurrentProjectiles = new List <ProjectileComponent>(); #if UNITY_EDITOR if (m_ProjectileHook == null) { KakutoDebug.LogError(K_PROJECTILE_HOOK + " can't be found on " + m_Owner); } #endif Utils.GetPlayerEventManager(m_Owner).StartListening(EPlayerEvent.ProjectileSpawned, OnProjectileSpawned); Utils.GetPlayerEventManager(m_Owner).StartListening(EPlayerEvent.ProjectileDestroyed, OnProjectileDestroyed); }
public override void OnInit(PlayerAttackComponent playerAttackComponent, PlayerAttack attack) { base.OnInit(playerAttackComponent, attack); m_GrabHook = m_Owner.transform.Find("Model/" + K_GRAB_HOOK); m_FXHook = m_Owner.transform.Find("Model/" + K_FX_HOOK); #if UNITY_EDITOR if (m_GrabHook == null) { KakutoDebug.LogError(K_GRAB_HOOK + " can't be found on " + m_Owner); } if (m_FXHook == null) { KakutoDebug.LogError(K_FX_HOOK + " can't be found on " + m_Owner); } #endif }
public async Task <Entity> CreatePlayerEntity() { var playerInput = new PlayerInputComponent(this); var playerGraphics = new PlayerGraphicsComponent(_spriteSheetLoader, _entitySpriteBatch, playerInput); await playerGraphics.LoadAsync(); var playerPhysics = new PlayerPhysicsComponent(_mapManager); var playerAttack = new PlayerAttackComponent(_spriteSheetLoader, _entitySpriteBatch); await playerAttack.LoadAsync(); var player = new Entity(playerInput, playerPhysics, playerGraphics, playerAttack); player.Position = new Vector2(75, 75); EntityRegistry.Add(player); PlayerEntity = player; return(player); }
public List <PlayerBaseAttackLogic> CreateLogics(PlayerAttackComponent playerAttackComponent) { List <PlayerBaseAttackLogic> attackLogics = new List <PlayerBaseAttackLogic>(); for (int i = 0; i < m_AttackList.Count; i++) { PlayerAttack attack = m_AttackList[i]; if (attack.m_AttackConfig) { PlayerBaseAttackLogic attackLogic = attack.m_AttackConfig.CreateLogic(); attackLogic.OnInit(playerAttackComponent, attack); attackLogics.Add(attackLogic); } else { KakutoDebug.LogError("No attack config found for " + attack.m_Name); } } return(attackLogics); }
public override EHitNotificationType GetHitNotificationType(EAttackResult attackResult, bool isInBlockingStance, bool isCrouching, bool isFacingRight, PlayerAttackComponent victimAttackComponent) { EHitNotificationType hitType = base.GetHitNotificationType(attackResult, isInBlockingStance, isCrouching, isFacingRight, victimAttackComponent); if (hitType == EHitNotificationType.None) { if (IsHitTakenInGuardCrush(isInBlockingStance, isCrouching)) { hitType = EHitNotificationType.GuardCrush; } } return(hitType); }
public virtual EHitNotificationType GetHitNotificationType(EAttackResult attackResult, bool isInBlockingStance, bool isCrouching, bool isFacingRight, PlayerAttackComponent victimAttackComponent) { if (victimAttackComponent.GetCurrentAttackLogic() != null) { EAttackState victimAttackState = victimAttackComponent.CurrentAttackState; if (victimAttackState == EAttackState.Startup || victimAttackState == EAttackState.Active) { return(EHitNotificationType.Counter); } } if (m_Attack.m_NeededStanceList.Contains(EPlayerStance.Jump) && m_MovementComponent.IsJumping()) { if (m_CurrentCrossupCoroutine != null) { m_AttackComponent.StopCoroutine(m_CurrentCrossupCoroutine); } m_CurrentCrossupCoroutine = ValidateCrossup_Coroutine(victimAttackComponent.transform); m_AttackComponent.StartCoroutine(m_CurrentCrossupCoroutine); } return(EHitNotificationType.None); }
public override EHitNotificationType GetHitNotificationType(EAttackResult attackResult, bool isInBlockingStance, bool isCrouching, bool isFacingRight, PlayerAttackComponent victimAttackComponent) { EHitNotificationType hitType = base.GetHitNotificationType(attackResult, isInBlockingStance, isCrouching, isFacingRight, victimAttackComponent); if (hitType == EHitNotificationType.None) { EAttackType attackType = m_Config.m_AttackType; switch (attackType) { case EAttackType.Low: hitType = EHitNotificationType.Low; break; case EAttackType.Overhead: if (!GetAttack().m_NeededStanceList.Contains(EPlayerStance.Jump)) { hitType = EHitNotificationType.Overhead; } break; } } return(hitType); }
public override void OnInit(PlayerAttackComponent playerAttackComponent, PlayerAttack attack) { base.OnInit(playerAttackComponent, attack); m_Rigidbody = playerAttackComponent.m_MovementComponent.m_Controller.m_Rigidbody2D; m_OriginalMass = m_Rigidbody.mass; }