-
Notifications
You must be signed in to change notification settings - Fork 28
MinimalScene
If you are interested in the barest minimum build to see bitcoin graph data, without any fancy visuals, then here is demo scene for you!
Take a look at the scene in the folder \Assets\B3d\Demos\Btc\Minimal\Scenes
. Open the scene called minimal
:
The most important game object is called B3dEngineAllInOne
. This is a prefab containing all the necessary game objects for the blockchain3D engine. All we have to provide to access graph data is a miminal graph factory object. A graph factory object is any game object with a script attached that implements IGraphFactory
. For example:
public class MinimalGraphFactory : MonoBehaviour, IGraphFactory
{
void Start()
{
// Request data for an address
Debug.Log("Asking for data for address...");
FrontEndController.Instance.GetAddressData("17mjNZWa3LVXnpiewKae3VkWyDCqKwt7PV", 1);
// Or use FrontEndController.Instance.GetTransactionData()
}
void IGraphFactory.CreateOrUpdateEdge(CdmEdge edgeNew)
{
// edgeNew contains all the interesting data about an edge
Debug.Log("Edge received: " + edgeNew.EdgeIdFriendly);
}
void IGraphFactory.CreateOrUpdateNode(CdmNode nodeNew)
{
// nodeNew contains all the interesting data about a node (an address or a transaction)
Debug.Log("Node received: " + nodeNew.NodeType + " " + nodeNew.NodeId);
}
}
Play the scene in the editor and watch the console. You will see some messages appear something like this showing the requested graph data arriving:
Green messages are issued by the engine, black messages from the demo scene.