private void ClickRoleType(int id) { new_login.Type = id; string type_name = RoleFactory.GetRoleNameByType(id); info_text.text = "<color=blue><size=24>" + type_name + "</size></color>\n" + roleDescription.getDescription(type_name); }
// Start is called before the first frame update private void Update_sprite() { for (int i = 0; i < 6; i++) { string path = "character_image/" + RoleFactory.GetRoleNameByType(i + 1); images[i].sprite = Resources.Load <Sprite>(path); } }
private void UpdateInfoDisplay() { //更新信息栏里面的个人信息 Role role = Game.getRole(); string info = ""; info += role.getName() + "\n"; info += RoleFactory.GetRoleNameByType(role.getType()) + "\n"; info += role.getGenderString() + "\n"; info += role.getSemester() + "\n\n"; info += role.getComputer_c() + "\n"; info += role.getMathmatic_c() + "\n"; info += role.getElectronic_c() + "\n"; info += role.getFinancial_c() + "\n\n"; info += role.getWisdom() + "\n"; info += role.getEQ() + "\n"; info += role.getStrength() + "\n"; info += role.getHair() + "\n"; info += role.getCharm() + "\n"; info += role.getGPA() + "\n"; role_info.text = info; role_description.text = RoleDescriptions.getRoleDescriptions().getDescription(RoleFactory.GetRoleNameByType(role.getType())); }
void onClick() { bool[] ok = { false, false, false }; if (string.Equals(name.text, null)) { //Debug.Log("请输入姓名!"); } else { Name = name.text; ok[1] = true; //Debug.Log("name = " + Name); } if (male.isOn) { isMale = true; ok[0] = true; // Debug.Log("male"); } else if (female.isOn) { isMale = false; ok[0] = true; // Debug.Log("female"); } else { //Debug.Log("请选择性别!"); } if (Type < 1 || Type > 6) { //Debug.Log("请选择角色!"); } else { ok[2] = true; //Debug.Log("type = " + Type); } if (ok[0] && ok[1] && ok[2]) { //login_info(Name, isMale, Type); // method from sjp's script Role role; Game.createRole(Name, isMale, Type); /*Debug.Log("charm = " + role.getCharm()); * Debug.Log("cs_c = " + role.getComputer_c()); * Debug.Log("math_c = " + role.getMathmatic_c()); * Debug.Log("fin_c = " + role.getFinancial_c()); * Debug.Log("ee_c = " + role.getElectronic_c()); * Debug.Log("EQ = " + role.getEQ()); * Debug.Log("ismale = " + role.getGender()); * Debug.Log("gpa = " + role.getGPA()); * Debug.Log("hair = " + role.getHair()); * Debug.Log("name = " + role.getName()); * Debug.Log("sem = " + role.getSemester()); * Debug.Log("strength = " + role.getStrength()); * Debug.Log("type = " + role.getType()); * Debug.Log("wisdom = " + role.getWisdom());*/ // jump to another scene, a string to be changed PlayerPrefs.SetFloat("position_x", 455f); PlayerPrefs.SetFloat("position_y", 15f); PlayerPrefs.SetFloat("position_z", -30); PlayerPrefs.SetFloat("euler_x", 0); PlayerPrefs.SetFloat("euler_y", 0); PlayerPrefs.SetFloat("euler_z", 0); PlayerPrefs.SetString("cg_id", "开场"); PlayerPrefs.SetString("next_scene", "BeginScene"); PlayerPrefs.SetString("char_image", "character_image/" + RoleFactory.GetRoleNameByType(Type)); SetInitialTransform(); SceneManager.LoadScene("CGScene"); } }
public void OnShowClick() { UpdateInfoDisplay(); main_panel.SetActive(!main_panel.activeSelf); role_description.text = RoleDescriptions.getRoleDescriptions().getDescription(RoleFactory.GetRoleNameByType(Game.getRole().getType())); }
// Start is called before the first frame update void Start() { character_image.sprite = Resources.Load <Sprite>("character_image/" + RoleFactory.GetRoleNameByType(Game.getRole().getType())); UpdateAllAttr(); //info_panel.SetActive(false); }