protected override void OnCollideToPlayer(ServerPlayer character, Vector2 point) { //When Hit My Player if (character) { if (owner == character.GetOwner()) return; if (character.IsDead()) return; DamageAround(new Vector2(transform.position.x, transform.position.y)); DestroyFromNetwork(); } }
protected override void OnCollideToPlayer(ServerPlayer character, Vector2 point) { //When Hit My Player if (character) { if (owner == character.GetOwner()) return; if (character.IsDead()) return; character.Damage(damage, new NetworkMessageInfo()); ImpactTarget(character.GetComponent<Rigidbody2D>(), impact); DestroyFromNetwork(); } }
public virtual void Init(ServerPlayer player, WeaponInfo weapon, FireInfo info) { owner = player.GetOwner(); direction = info.direction; GetComponent<Rigidbody2D>().AddForce(direction * GetPower(weapon), ForceMode2D.Impulse); long projID = ProjectileManager.Inst.GetUniqueKeyForNewProjectile(); ProjectileManager.Inst.Set(projID, this); Physics2D.IgnoreCollision(collider, player.GetComponent<Collider2D>()); OnInit(); BroadcastInit(); }
protected override void OnCollideToPlayer(ServerPlayer character, Vector2 point) { if (stickInfo.isSticked) return; //When Hit My Player if (character) { if (owner == character.GetOwner()) return; if (character.IsDead()) return; ConnectRope(character); } }