Roba Memo - 素人のUnity覚書と奮闘記

素人のUnity覚書と奮闘記

型変換

int → string

String str = 50.ToString();

string → int

int num = int.Parse("50");

bool → int

using System;

Convert.ToInt32(bool値);

int → bool

using System;

Convert.ToBoolean(int値);

int → float

int a = 1;
float b = (float)a;

float → int

float a = 1;
int b = (int)a;