protected virtual void Die() { isDead = true; if (isServer) { motor.MoveToPoint(transform.position); RpcDie(); } }
protected virtual void Die() { _isDead = true; GetComponent <Collider>().enabled = false; EventOnDie(); if (isServer) { HasInteract = false; RemoveFocus(); _motor.MoveToPoint(transform.position); RpcDie(); } }
protected virtual void Die() { IsDead = true; if (!isServer) { return; } HasInteract = false; // с объектом нельзя взаимодействовать RemoveFocus(); Motor.MoveToPoint(transform.position); EventOnDie?.Invoke(); RpcDie(); }
private void Update() { if (Input.GetMouseButtonDown(1)) { if (Physics.Raycast(_cam.ScreenPointToRay(Input.mousePosition), out var hit, 100f, _movementMask)) { _motor.MoveToPoint(hit.point); } } if (Input.GetMouseButtonDown(0)) { if (Physics.Raycast(_cam.ScreenPointToRay(Input.mousePosition), out _, 100f)) { } } }
public void Command(Ray ray) { RaycastHit hit; if (Physics.Raycast(ray, out hit, 100)) { //Set focus Interacteble interactable = hit.collider.GetComponent <Interacteble>(); if (interactable != null) { SetFocus(interactable); } else { RemoveFocus(); //Move entity to pos if (Physics.Raycast(ray, out hit, 100, movmentMask)) { motor.MoveToPoint(hit.point); } } } }
void Update() { if (Input.GetMouseButtonDown(1)) { Ray ray = cam.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit, 100f, movementMask)) { motor.MoveToPoint(hit.point); } } if (Input.GetMouseButtonDown(0)) { Ray ray = cam.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit, 100f)) { } } }
public void MoveToPoint(Vector3 vectorMagtanggol) { motor.MoveToPoint(vectorMagtanggol); }