示例#1
0
    //private bool hasPlayer;
    //private GameObject player;
    //Interest point


    // Start is called before the first frame update
    void Start()
    {
        map = new MapTile[width, height];
        Messenger.AddReturnListener <Vector3, ResourceType.AttributionType, Vector2Int, int, int>(EventCode.MAP_REDUCE_RESOURSE, ReduceResource);
        Messenger.AddListener <AppManage.SingleSave>(EventCode.APP_START_GAME, StartInit);
        HideResourse();
    }
示例#2
0
 // Start is called before the first frame update
 void Start()
 {
     warehouse = new Dictionary <string, int>();
     //foreach (var type in resourceTypes)
     //{
     //    warehouse.Add(type.resName,0);
     //}
     //if (canvas==null)
     //{
     //    canvas = GameObject.FindObjectOfType<RectTransform>();
     //}
     Messenger.AddListener <Dictionary <string, int> >(EventCode.RESOURCE_ADD, Add);
     Messenger.AddReturnListener <Dictionary <string, int>, bool>(EventCode.RESOURCE_CHECK, Check);
     Messenger.AddListener <Dictionary <string, int> >(EventCode.RESOURCE_REDUCE, Remove);
 }
示例#3
0
 // Use this for initialization
 void Start()
 {
     autoSize = Screen.height / (1080 / autoSize);
     autoTop  = Screen.height / (1080 / autoTop);
     autoLeft = Screen.width / (1920 / autoLeft);
     left     = Screen.width / (1920 / left);
     top      = Screen.height / (1080 / top);
     AutoXY(GetComponent <RectTransform>().sizeDelta.x, GetComponent <RectTransform>().sizeDelta.y);
     if (isAuto)
     {
         NotExistItems();
     }
     else
     {
         ExistItems();
     }
     bagItems    = new int[allCapacity];
     bagCapacity = allCapacity;
     ShowEquip();
     Messenger.AddReturnListener <ItemInfo, bool>(EventCode.BAG_ADD_ITEM, BagAddItem);
     Messenger.AddListener <AppManage.SingleSave>(EventCode.APP_START_GAME, StartInit);
     // StartCoroutine(test());
 }
示例#4
0
    //private bool hasPlayer;
    //private GameObject player;
    //Interest point


    // Start is called before the first frame update
    void Start()
    {
        map = new MapTile[width, height];
        Messenger.AddReturnListener <Vector3, ResourceType.AttributionType, Vector2Int, int, int>(EventCode.MAP_REDUCE_RESOURSE, ReduceResource);
        HideResourse();
    }