Подскажите, пожалуйста как правильно конвертить double в int? Что я делаю не так?
Синтаксис:
Используется csharp
using UnityEngine;
using System.Collections;
using System.Data;
using System;
public class Controller : MonoBehaviour {
...
public void MitishiInfo(int windowID) {
Matrix4x4 matrixBackup = GUI.matrix;
double thisAngleDouble = (-90 + busyMitishi*0.173);
int thisAngle = System.ConvertToInt32(thisAngleDouble);
Vector2 pos = Vector2(123,110);
GUIUtility.RotateAroundPivot(thisAngle, pos);
Rect thisnew = new Rect(83,70,80,80);
GUI.DrawTexture(thisnew , testTexture);
GUI.matrix = matrixBackup;
}
}
using System.Collections;
using System.Data;
using System;
public class Controller : MonoBehaviour {
...
public void MitishiInfo(int windowID) {
Matrix4x4 matrixBackup = GUI.matrix;
double thisAngleDouble = (-90 + busyMitishi*0.173);
int thisAngle = System.ConvertToInt32(thisAngleDouble);
Vector2 pos = Vector2(123,110);
GUIUtility.RotateAroundPivot(thisAngle, pos);
Rect thisnew = new Rect(83,70,80,80);
GUI.DrawTexture(thisnew , testTexture);
GUI.matrix = matrixBackup;
}
}
В консоли ошибка: The type or namespace name `ConvertToInt32' does not exist in the namespace `System'. Are you missing an assembly reference?
На даже не приходилось конвертировать, переменная thisAngle прекрасно воспринималась как int:
Синтаксис:
Используется javascript
var thisAngle:int = (-90 + busyMitishi*0.85);