Converting float to int typedata c# js unity

question is solved

answer:

  1. http://forum.unity3d.com/threads/solved-typecast-float-to-int-in-javascript.30618/
  2. http://forum.unity3d.com/threads/converting-float-to-integer.27511/

sample code

public float HighMeter = 0;
string highMeterKey = "HighMeter";

int iValue = (int)PlayerPrefs.GetFloat(highMeterKey);
Debug.Log("int val: " +iValue);
long iValue2 = (long)PlayerPrefs.GetFloat(highMeterKey);
Debug.Log("long val: " +iValue2);

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s