You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
using System;
|
|
|
|
using Unity.Netcode;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace Game {
|
|
|
|
public class Ball : NetworkBehaviour {
|
|
|
|
public Rigidbody2D rb;
|
|
|
|
|
|
|
|
public float Radius => transform.localScale.x / 4;
|
|
|
|
|
|
|
|
public bool IsAlive {
|
|
|
|
get {
|
|
|
|
float y = transform.position.y;
|
|
|
|
float y1 = BorderSize.Singleton.y1;
|
|
|
|
float y2 = BorderSize.Singleton.y2;
|
|
|
|
return y > y1 && y < y2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private void OnEnable() {
|
|
|
|
rb = GetComponent<Rigidbody2D>();
|
|
|
|
}
|
|
|
|
|
|
|
|
private void Start() {
|
|
|
|
rb.velocity = new Vector2(0, 20);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|