void Update()
        {
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
            RaycastHit hit = new RaycastHit();


            if (Input.GetMouseButtonDown(0))
            {
                if (Physics.Raycast(ray, out hit))
                {
                    var pos = hit.point;
                    pos.y = height;
                    Debug.Log(pos);
                    var message = new DamageObjectMessage
                    {
                        damageObjectFallingPos = pos,
                    };

                    var tmpObj = GameObject.Instantiate(damageObject, pos, Quaternion.identity);
                    NetworkClient.Send(message);
                }
            }
        }
Beispiel #2
0
 private void GetDamageObjectMessage(NetworkConnection conn, DamageObjectMessage message)
 {
     OnGetDamageObjectFallingPos?.Invoke(message.damageObjectFallingPos);
 }