private void Awake() { if (StaticInstance == null) { StaticInstance = this; DontDestroyOnLoad(this.gameObject); playerRB = GetComponent <Rigidbody>(); source = GetComponent <CinemachineImpulseSource>(); playerAttackInput = GetComponent <AttackInput>(); } else { Destroy(this.gameObject); } }
public override void Initialize() { this.MaxJumpCount = 1; this.JumpForce = 600; this.MovementAccelerationForce = 18; this.MaxMovementSpeed = 2; this.rb.gravityScale = 2; this.rb.drag = 2; this.CanJump = true; moveLeft = new MoveLeft(); moveRight = new MoveRight(); slide = new Slide(); jump = new Jump(); attackInput = new AttackInput(); }
public void OnAttack(InputValue value) { var attack = new AttackInput { }; inputBuffer.AddInput(CharSelector.SelectedCharacter, attack); var button = new ButtonInput { is_press = value.isPressed, is_release = !value.isPressed, button_name = "Attack", value = value.Get <float>() }; inputBuffer.AddInput(CharSelector.SelectedCharacter, button); }
public void NewAttack(Slash slash, AttackInput attackInput, DirectionalInput directionalInput, bool aerial) { if (slash != null) { for (int i = 0; i < slash.combos.Count; i++) { if (attackInput == slash.combos[i].attackInput && directionalInput == slash.combos[i].directionalInput && slash.combos[i].aerialAttack == playerMovement.inAir) { curSlash = slash.combos[i]; if (slash.combos[i].launchAttack) { nextSlash = slash.combos[i]; } else { slash.combos[i].NewAttack(this, slash.combos[i]); } return; } } for (int o = 0; o < slash.combos.Count; o++) { if (attackInput == slash.combos[o].attackInput && slash.combos[o].directionalInput == DirectionalInput.none && slash.combos[o].aerialAttack == playerMovement.inAir) { curSlash = slash.combos[o]; if (slash.combos[o].launchAttack) { nextSlash = slash.combos[o]; } else { slash.combos[o].NewAttack(this, slash.combos[o]); } return; } } NewAttack(baseSlash, attackInput, directionalInput, inAir); } }
IEnumerator Start() { increment = new WaitForSecondsRealtime(.1f); yield return(null); AttackInput playerAttackInput = PersistantPlayer.StaticInstance.playerAttackInput; while (true) { int i = 0; foreach (Attackdef attack in playerAttackInput.attacks) { Color tempColor = abilityArray[i].color; tempColor.a = attack.currentCooldown / attack.attackCooldown; tempColor.a *= Convert.ToInt32(attack.isUnlocked); //Debug.Log($"{attack.lensType} alpha is {tempColor.a}"); abilityArray[i].color = tempColor; i++; } yield return(increment); } }
public virtual void ContinueAttack(ComboHolder combo, Slash slash, AttackInput attack, DirectionalInput directionalInput) { for (int i = 0; i < combos.Count; i++) { if (attack == combos[i].attackInput && directionalInput == combos[i].directionalInput) { NewAttack(combo, combos[i]); return; } } for (int o = 0; o < combos.Count; o++) { if (attack == combos[o].attackInput && combos[o].directionalInput == DirectionalInput.none) { NewAttack(combo, combos[o]); return; } } NewAttack(combo, slash); }
public virtual void ContinueAttack(ComboHolder combo, AttackInput attack, DirectionalInput dirInput, bool aerial) { combo.NewAttack(combo.curSlash, attack, dirInput, aerial); }