Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

MinimalScene

KevinSmall edited this page Aug 29, 2018 · 5 revisions

Usage of a Minimal Scene

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 that implements IGraphFactory:

public class MinimalGraphFactory : MonoBehaviour, IGraphFactory
{
   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);
   }

   void Start()
   {
      // Request data for an address
      Debug.Log("Asking for data for address...");
      FrontEndController.Instance.GetAddressData("17mjNZWa3LVXnpiewKae3VkWyDCqKwt7PV", 1);
      // Or use FrontEndController.Instance.GetTransactionData()
   }
}

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.

Clone this wiki locally