API Connector

Now, we will create the connector like the Azure Bridge that we created during previous chapter exercise, which fetches the data from the services and map it with the Product Data Model, we just defined.

  1. In Unity Project Explorer window, Navigate to Assets | Scripts folder.
  2. Add a new script by navigating from context menu | Create | C# Scripts, name it APIConnector.
  3. Open the script file in Visual Studio.

At a very first step, we will make this class as Singleton to use only one instance of it. You can achieve this by just inheriting the class from Singleton class, by passing the same class type as parameter.

public class APIConnector : Singleton<APIConnector>{
void Start () {
}
void Update () {
}
}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.97.216