Example #1
0
 public override void OnDrop()
 {
     if (dropWeapon)
     {
         Instantiate(dropWeapon, LandHelper.ChooseLand(transform.position, new Rect(-1, -2, 2, 3)),
                     transform.rotation);
     }
 }
Example #2
0
    private void ProcessReceivedLandsData(Promise <List <Land> > landPromise, string jsonValue, string lowerCaseAddress, bool cache)
    {
        try
        {
            LandQueryResultWrapped result = JsonUtility.FromJson <LandQueryResultWrapped>(jsonValue);
            List <Land>            lands  = LandHelper.ConvertQueryResult(result.data, lowerCaseAddress);

            if (cache)
            {
                landQueryCache[lowerCaseAddress] = new QueryLandCache()
                {
                    lands = lands, lastUpdate = Time.unscaledTime
                };
            }

            landPromise.Resolve(lands);
        }
        catch (Exception exception)
        {
            landPromise.Reject(exception.Message);
        }
    }