コード例 #1
0
ファイル: State.cs プロジェクト: Ingeniium/Soul-Wars
    public IEnumerator SetState(Type type, Vector3 vec, float dist = -1)
    {
        List <SpawnManager> oppenent_spawns = SpawnManager.GetOpponentSpawns(transform.parent.gameObject.layer);

        while (oppenent_spawns.Count == 0)
        {
            yield return(new WaitForEndOfFrame());
        }
        switch (type)
        {
        case Type.Conquer:
        {
            State = new Conquer(this);
            break;
        }

        case Type.HuntPlayers:
        {
            State = new HuntPlayers(this);
            break;
        }

        case Type.HuntSpawn:
        {
            State = new HuntSpawns(this);
            break;
        }

        case Type.Guard:
        {
            if (vec == Vector3.zero)
            {
                State = new Guard(this, dist);
            }
            else
            {
                State = new Guard(this, vec, dist);
            }
            break;
        }
        }
    }
コード例 #2
0
ファイル: MapActivity.cs プロジェクト: bkmza/goandfindme
        async void QuestHandler()
        {
            if (!CheckInternetConnection())
            {
                IsLoading = false;
                return;
            }

            string description = this.Resources.GetString(Resource.String.GPSNotDefined);

            if (_currentLocation != null)
            {
                Conquer result = await _apiService.Quest(DeviceUtility.DeviceId, _currentLocation.Latitude.ProcessCoordinate(), _currentLocation.Longitude.ProcessCoordinate());

                description = result.GetDescription;
                if (result.IsSuccess)
                {
                    UpdateMarkers();
                }
            }

            IsLoading = false;
            this.ShowAlert(description);
        }