VlazhnostTimerTread = new Thread(() =>
{
Invoke((Action)(() =>
{
HumidityReception();//System.InvalidOperationException: "Невозможно вызвать Invoke или BeginInvoke для элемента управления до завершения создания дескриптора окна."
}));
});
VlazhnostTimerTread = new Thread(() => HumidityReception());
private void HumidityReception()
{
//-----
Invoke((Action)(() => AddString(data));
//-----
}
private float muveInput; // это таки float, цифирь с плавающей точкой
/*
------
*/
muveInput = muveInput.GetAxis("Horizoontal"); // и никакого GetAxis у него нет.
private float muveInputHAxis;
muveInputHAxis = muveInput.GetAxis("Horizoontal");
using System;
using System.Linq;
using System.Collections.Generic;
public class Program
{
public static void Main()
{
var list = new List<int> {1,2,3,4,5,6,7,8,9};
list.Top(30).ToList().ForEach(x => Console.WriteLine(x));
}
}
public static class IEnumerableExt
{
public static IEnumerable<T> Top<T>(this IEnumerable<T> list, double percent)
{
var elementCount = (int)Math.Ceiling((double)list.Count() * percent / 100);
return list.OrderByDescending(x => x).Take(elementCount);
}
}
bool IsFpNumsEqual(float a, float b, float eps = 1.0E-5f) => Math.Abs(a - b) < eps;
joystick = GameObject.FindGameObjectsWithTag("Joystick").FirstOrDefault()?.GetComponent<Joystick>();
public static void Move(this Transform transform, Vector3 target, float time, AnimationCurve curve = null)
transform.position = Vector3.Lerp(start, target, curve != null ? curve.Evaluate(deltaTime) : deltaTime);
private void checkBox1_Click(object sender, System.EventArgs e)
{
// The CheckBox control's Text property is changed each time the
// control is clicked, indicating a checked or unchecked state.
if (checkBox1.Checked)
{
checkBox1.Text = "Checked";
}
else
{
checkBox1.Text = "Unchecked";
}
}