Example #1
0
 // Update is called once per frame
 private void Update()
 {
     //Testing if it works add resources
     if (Input.GetKeyDown(KeyCode.Space))
     {
         ResourceTypeListSO resourceTypeList = Resources.Load <ResourceTypeListSO>(typeof(ResourceTypeListSO).Name);
         addResource(resourceTypeList.getResourcesTypeList()[0], 1);
         TestLogDic();
     }
 }
Example #2
0
    private void Awake()
    {
        //Initialize the dictionary with current types of resources and set to 0
        resourceAmountDictionary = new Dictionary <ResourceTypeSO, int>();
        ResourceTypeListSO resourceTypeList = Resources.Load <ResourceTypeListSO>(typeof(ResourceTypeListSO).Name);

        foreach (ResourceTypeSO resourceType in resourceTypeList.getResourcesTypeList())
        {
            resourceAmountDictionary[resourceType] = 0;
        }
    }