void ReceiveEvaluatorResult(string content) { Result result = XmlParser.Parse(content); if (result.error == Error.NORMAL) { float time; if (result.score.total > 4) { Hint.GetInstance().Show("棒极了!", "Perfect!"); time = Audio.GetInstance().Play(AudioType.INTRO, "perfect"); } else if (result.score.total > 3) { Hint.GetInstance().Show("非常棒!", "Great!"); time = Audio.GetInstance().Play(AudioType.INTRO, "great"); } else if (result.score.total > 2) { Hint.GetInstance().Show("不错!", "Good!"); time = Audio.GetInstance().Play(AudioType.INTRO, "good"); } else { Hint.GetInstance().Show("加油!", "Come on!"); time = Audio.GetInstance().Play(AudioType.INTRO, "comeon"); } } }
public void LoginResult(StudentInfo si) { if (si != null) { Role.currentRole.id = si.id; Hint.GetInstance().Show("不错嘛,跟我来!", "Not bad, follow me!"); LoginSuccess(); } }
void LoginResult(int code) { if (code == 0) { Hint.GetInstance().Show("不错嘛,跟我来!", "Not bad, follow me!"); LoginSuccess(); } else { Hint.GetInstance().Show("别想玩我,这个人根本不存在!", "The user is not exist!"); } }
public void NewRegisterResult(int code) { if (code == 0) { Hint.GetInstance().Show("好了,让我们走!", "Well done, let's go!"); RegisterSuccess(); } else { Hint.GetInstance().Show("对不起,注册失败!", "Sorry,register failed!"); } }
public void LoginResult(int code) { if (code == 0) { Hint.GetInstance().Show("不错嘛,跟我来!", "Not bad, follow me!"); LoginSuccess(); } else { Hint.GetInstance().Show("用户名不存在啊!", "User is not exist!"); } }
void ReceiveEvaluatorResult(string content) { voiceHint = false; Result result = XmlParser.Parse(content); if (result.error == Error.NORMAL) { Sentence sentence = Sentence.Get(dialog.answerIds[answerIndex]); Server.GetInstance().Studying(sentence, result.score.total); iPlay.PlayAnimation(sentence.anim); iPlay.Hide(); totalScore += result.score.total; float time = 0.5f; if (result.score.total > 4) { Hint.GetInstance().Show("棒极了!", "Perfect!"); //time = Audio.GetInstance().Play(AudioType.INTRO, "perfect"); } else if (result.score.total > 3) { Hint.GetInstance().Show("非常棒!", "Great!"); //time = Audio.GetInstance().Play(AudioType.INTRO, "great"); } else if (result.score.total > 2) { Hint.GetInstance().Show("不错!", "Good!"); //time = Audio.GetInstance().Play(AudioType.INTRO, "good"); } else { Hint.GetInstance().Show("加油!", "Come on!"); //time = Audio.GetInstance().Play(AudioType.INTRO, "comeon"); } ShowStar(result.score.total); index++; StartCoroutine(Evaluating(time, SUCCESS)); } else { StartCoroutine(Evaluating(0, FAILED)); } }
public void Keyboard() { if (string.IsNullOrEmpty(userName.text)) { Hint.GetInstance().Show("用户名忘记输入了吧?", "Please input the user name!"); } else if (string.IsNullOrEmpty(password.text)) { Hint.GetInstance().Show("密码为空吧?", "Please input the password!"); } else { Login(); } }
public void Inputing(string info) { string[] splitTimes = info.Split(':'); int speakTime = int.Parse(splitTimes[0]); if (speakTime < SPEAK_TIMES) { Hint.GetInstance().Show("请再次说出 \"芝麻开门\"!", "Say \"芝麻开门\" again!"); } else { Hint.GetInstance().Show("好的,可以了!", "Ok, very good!"); } TimesHint(speakTime); }
public void OnPointerDown(PointerEventData eventData) { if (isHintMode) { StartCoroutine(MoveFigureByHint()); Hint.GetInstance().HintUsedOnFigure(figureIndex); } if (!canDragging) { return; } isDragging = true; canDragging = false; UpdateFigureParts(figureCellSize, figureTile); UpdateBoxCollider(Vector2.zero, new Vector2(figureCellSize * 0.6f, figureCellSize * 0.6f)); }
void LoginResult(StudentInfo si) { if (si != null) { Role.currentRole.id = si.id; Hint.GetInstance().Show("不错嘛,跟我来!", "Not bad, follow me!"); LoginSuccess(); } else //if (code == 1) { Hint.GetInstance().Show("别想玩我,这个人根本不存在!", "The user is not exist!"); } //else if (code == 2) //{ // Hint.GetInstance().Show("别想蒙混过关,你的口令根本不对!", "The password is wrong!"); //} }
void Update() { if (currentPlant == null) { return; } if (growthRemaining > 0.0f) { growthRemaining -= Time.deltaTime; if (growthRemaining > 0.0f) { currentPlant.Grow(false); } else { growthRemaining = 0.0f; currentPlant.FinishGrowing(); if (Hint.GetInstance()) { Hint.GetInstance().ShowLeftButton(); } } } else { if (Input.GetButtonDown("Grow")) { currentPlant.StartGrowing(); } else if (Input.GetButton("Grow")) { currentPlant.Grow(true); } else if (Input.GetButtonUp("Grow")) { currentPlant.FinishGrowing(); } else if (Input.GetButton("Retract")) { currentPlant.Retract(); } } }
public void RegisterEnter() { ////测试代码 //Role.currentRole = new Role(); //Role.currentRole.userName = userName.text; ////测试代码 if (Role.voiceName == userName.text) { Role.currentRole = new Role(); Role.currentRole.userName = userName.text; Role.NewRegister(userName.text, password.text, NewRegisterResult); } else { Hint.GetInstance().Show("声纹信息还没有录制!", "Voice print has not recorded!"); } //Role.Register(userName.text, password.text, RegisterResult); }
public void Grow(bool controlledByPlayer) { if (stem.Length() < maxLength) { growthController.Grow(); if (controlledByPlayer) { objectAimer2D.Aim(); } } else { if (Hint.GetInstance()) { Hint.GetInstance().ShowRightButton(); } growthController.FinishGrowing(); } }
public void Voice() { if (string.IsNullOrEmpty(userName.text)) { Hint.GetInstance().Show("用户名忘记输入了吧?", "Please input the user name!"); } else { if (Role.UserExist(userName.text)) { Hint.GetInstance().Show("请说出 \"芝麻开门\"!", "Please say \"芝麻开门\"!"); GameObject.Find("Agent").GetComponent <Agent>().StartVerify(userName.text, "芝麻开门", VoiceprintSucess, VoiceprintFailed); } else { Hint.GetInstance().Show("用户不存在啊,注册一个新的吧!", "User is not exist!"); } } }
public void RegisterVoiceprint() { if (!string.IsNullOrEmpty(userName.text)) { //if (!Role.UserExist(userName.text)) //{ Hint.GetInstance().Show("请说出 \"芝麻开门\"!", "Password say \"芝麻开门\"!"); GameObject.Find("Agent").GetComponent <Agent>().StartRegister(userName.text, "芝麻开门", Inputing, InputSuccess); TimesHint(0); //} //else //{ // Hint.GetInstance().Show("很遗憾,重复了!", "Sorry, name already exist!"); //} } else { Hint.GetInstance().Show("用户名为空!", "User name is null!"); } }
public void RegisterResult(int code)//0=Success 1=UserName 2=Password 3=Voiceprint { if (code == 0) { Role.currentRole.passWord = password.text; Role.roles.roleList.Add(Role.currentRole); Hint.GetInstance().Show("好了,让我们走!", "Well done, let's go!"); RegisterSuccess(); } else if (code == 1) { Hint.GetInstance().Show("很遗憾,重复了!", "Sorry, name already exist!"); } else if (code == 2) { Hint.GetInstance().Show("密码需要至少6位!", "Password is not less than 6 charactor!"); } else if (code == 3) { Hint.GetInstance().Show("还没录入暗号呢!", "Voice print has not recorded!"); } }
// Update is called once per frame void Update() { if (Input.anyKeyDown) { if (Hint.GetInstance()) { Hint.GetInstance().HideHints(); delayForHint = 0.0f; } rigidbody.gravityScale = targetGravity; Destroy(this); } if (delayForHint > 0.0f) { delayForHint -= Time.deltaTime; if (delayForHint <= 0.0f && Hint.GetInstance()) { Hint.GetInstance().ShowAnyButton(); } } }
public void HandleRewardBasedVideoRewarded(object sender, Reward args) { Hint.GetInstance().AddHints(); }
public void VoiceprintFailed(string info) { Hint.GetInstance().Show("再说一遍,我没听清楚!", "Wrong!"); GameObject.Find("Agent").GetComponent <Agent>().StartVerify(userName.text, "芝麻开门", VoiceprintSucess, VoiceprintFailed); }
private void Start() { Hint.GetInstance().Show("欢迎来到光和空间!", "Welcome to Lightray+Space!"); Audio.GetInstance().Play(AudioType.INTRO, "welcome"); }
private void OnEnable() { Hint.GetInstance().Show("点击按钮,说出\"芝麻开门\"!", "Click button, say \"芝麻开门\"!"); }