void ChangeStatus(int val) { string[] paramStr = { "", "温度", "空気", "重力", "質量" }; state = (MAIN_PARA_ID)((int)(state + 1) % (int)MAIN_PARA_ID.MAXID); GetComponent <Renderer>().material.color = colerPattern[(int)state]; myText.text = paramStr[(int)state]; }
void StatusCheck() { for (int i = 0; i < planet_num; i++) { MAIN_PARA_ID id = (MAIN_PARA_ID)planet[i].GetComponent <PlanetStatusChange>().GetState(); planetStatus[(int)id]++; } for (int i = 0; i < (int)MAIN_PARA_ID.MAXID; i++) { PlayerPrefs.SetInt("Data0MainPara" + mainParamName[i], planetStatus[i]); } }
public void SetParam(int mParam, int sParam) { mainParam = (MAIN_PARA_ID)mParam; subParam = (SAB_PARA_ID)sParam; string[] mpStr = { "normal", "tempe", "air", "grav", "mass" }; string[] spStr = { "water", "elec", "pois", "metal" }; //,"subnormal???" }; Debug.Log((int)mainParam + ":" + (int)subParam); Debug.Log(mpStr[(int)mainParam] + ":" + spStr[(int)subParam]); gameObject.GetComponent <Renderer>().material.color = colerPattern[(int)mainParam]; GameObject a = Instantiate(iconPrefab[(int)subParam], gameObject.transform); a.transform.parent = gameObject.transform; a.transform.localPosition = new Vector3(0, -0, -0); a.transform.localPosition += new Vector3(0.0f, -0.0f, -0.015f); }