public void OnDamageNotification(DamageNotification notification)
    {
        var bracket = brackets.FindBracket(notification.Target.gameObject);
        if (!bracket)
        {
            return;
        }

        var pos = bracket.transform.position;

        DamageNumber.CreateFromPrefab(damageNumber, notification.Amount, pos, this);        
    }
Example #2
0
        public override void Read(IStarboundStream stream)
        {
            CauseEntityId = stream.ReadSignedVLQ();
            DamageN       = DamageNotification.FromStream(stream);

            /*
             * TargetEntityId = stream.ReadSignedVLQ();
             * PositionX = stream.ReadSignedVLQ() / 100;
             * PositionY = stream.ReadSignedVLQ() / 100;
             * Damage = stream.ReadSignedVLQ() / 100;
             * DamageKind = stream.ReadUInt8();
             * DamageSourceKind = stream.ReadString();
             * TargetMaterialKind = stream.ReadString();
             * HitResultKind = stream.ReadUInt8();
             */
        }