private void OnValidKeyPress(InputType input, bool last) { if (last) { return; } WeakAttack wa = Object.Instantiate(weakAttack, player.transform.position, Quaternion.identity); Vector3 direction = Vector3.zero; switch (input) { case InputType.Green: direction = (Vector3.forward + Vector3.right).normalized; break; case InputType.Red: direction = (Vector3.right + Vector3.back).normalized; break; case InputType.Yellow: direction = (Vector3.left + Vector3.forward).normalized; break; case InputType.Blue: direction = (Vector3.back + Vector3.left).normalized; break; } wa.Init(weakAttackDamage, aimBot, direction, color); }
internal static void Demo() { IKernel kernel = new StandardKernel(new SimpleNamedModule()); var weapon = kernel.Get <IWeapon>(); var attack = new WeakAttack(weapon); attack.Attack("test"); kernel.Get <IWeapon>("Weak"); // NOTE: Service location! }
private void OnTriggerEnter(Collider other) { if (isAttacking && other.tag == "Player") { Debug.Log("ViewID: " + other.gameObject.GetComponentInParent <PhotonView>().viewID); opponentRB = other.GetComponentInParent <Rigidbody>(); opponentHealth = other.GetComponentInParent <PlayerHealth>(); opponentMovement = other.GetComponentInParent <CharacterMovement>(); opponentAnim = other.GetComponentInParent <Animator>(); opponentWAtk_Script = other.GetComponentInChildren <WeakAttack>(); DealDamage(); opponentWAtk_Script.Knockback(); Animate(); } }