public void CmdGather(int damage) { currentLife -= damage; if (currentLife <= 0) { List <GameObject> spawnedObjects = resourceDescriptor.Spawn(this.transform.position, 1); foreach (GameObject spawnedObject in spawnedObjects) { NetworkServer.Spawn(spawnedObject); } Destroy(this.gameObject); } }
public void Drop(Vector3 _position) { m_item.Spawn(_position); m_item = null; }