示例#1
0
    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();
        }
    }
示例#2
0
    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();
        }
    }
示例#3
0
    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();
    }
示例#4
0
    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);
        }
    }