// public float dissDistance = 5; // public float dieTime = 30f; // private Animation tagt; // Use this for initialization void Start() { diss = this; rbody = GetComponent <Rigidbody>(); ani = GetComponent <Animation>(); // ta = GameObject.FindWithTag("Player").transform; // ta = player._instance.transform; // tagt = GameObject.FindWithTag("Player").animation; }
public async Task <bool> PostGDissAsync(Diss diss, string accessToken) { var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); var json = JsonConvert.SerializeObject(diss); HttpContent content = new StringContent(json); content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); var response = await client.PostAsync(Constants.BaseApiAddress + "api/Discussion", content); if (response.IsSuccessStatusCode) { return(true); } return(false); }
private async void OpenPage(string value) { if (string.IsNullOrWhiteSpace(DiscussionText)) { await App.Current.MainPage.DisplayAlert(AppResource.er, AppResource.dissw, AppResource.ok); } else { if (Settings.AccessToken == "") { await App.Current.MainPage.DisplayAlert(AppResource.er, AppResource.nonuser, AppResource.ok); await Application.Current.MainPage.Navigation.PushModalAsync(new LoginPage()); } else { var gdiss = new Diss { DiscussionText = DiscussionText, Type = 1, }; DependencyService.Get <IProgressInterface>().Show(); var isAutho = await _apiService.PostGDissAsync(gdiss, Settings.AccessToken); DependencyService.Get <IProgressInterface>().Hide(); if (isAutho) { await Application.Current.MainPage.Navigation.PushModalAsync(new Consulting()); } else { await App.Current.MainPage.DisplayAlert(AppResource.er, AppResource.nonuser, AppResource.ok); await Application.Current.MainPage.Navigation.PushModalAsync(new LoginPage()); } } } }