Example #1
0
        public void destroy()
        {
            Material material = this.getType();

            setType(Material.AIR);

            for (int x = 0; x < material.getDropAmount(); x++)
            {
                DropEntity droppedBlock = new DropEntity(material.getDropType(), new Location(location.getX() + 0.6 * x, location.getY()));
            }
        }
    public DropEntity CreateDropEntity(string itemID, Vector3 pos = default, Vector3 force = default)
    {
        GameObject gameObject = Instantiate(dropEntityPrefab, dropEntityParent.transform);

        gameObject.transform.position = pos;
        DropEntity dropEntity = gameObject.GetComponent <DropEntity>();

        dropEntity.InitDropItem(itemID);
        Rigidbody rigidbody = gameObject.GetComponent <Rigidbody>();

        rigidbody.AddForce(force, ForceMode.VelocityChange);
        return(dropEntity);
    }