Ejemplo n.º 1
0
    protected void ShootBullet(Fixed2 position, Fixed2 direction)
    {
        UnityEngine.Debug.DrawRay(position.ToVector3(), direction.ToVector3() * 10, UnityEngine.Color.red, 0.1f);
        var others = data.client.physics.OverlapShap(ray.ResetDirection(position, direction, new FixedNumber(10)));

        foreach (var other in others)
        {
            if (other != data)
            {
                if (other is HealthData)
                {
                    (other as HealthData).GetHurt(new FixedNumber(10));
                }
            }
        }
        //Bullet bullet = new Bullet();
        //bullet.user = data;
        //bullet.Init(data .client);
        //bullet.Reset(position, rotation);
        //data.client.objectManager.Instantiate(bullet);
    }
Ejemplo n.º 2
0
 public void OnDrag(Fixed2 fixed2)
 {
     dirTarget.transform.rotation = Quaternion.LookRotation(fixed2.ToVector3());
 }