// private KeywordRecognizer m_Recognizer; // Use this for initialization public void ProcessInput() { //call a variable based on string name? if (touchCount == 1) { dialogueHandler.Narrate("FirstKnock", 2); exHandler.Expression(exHandler.notice, 1.0f); } randCount = UnityEngine.Random.Range(1, 3); switch (randCount) { case 1: if (eggParameter.TotalParameter >= eggParameter.PhaseA) { if (!eggPhysicalAI.isBusy) { eggParameter.AddParameter(0, 2, 0); eggPhysicalAI.RotateTowards(touchPosition); exHandler.Expression(exHandler.notice, 1.0f); } } break; case 2: //Debug.Log("Jumpting towards you"); eggParameter.AddParameter(0, 2, 0); eggPhysicalAI.JumpCloser(touchPosition); break; default: break; } }
public IEnumerator IHeatUp() { heatLevel = 0; heatRed = Mathf.Clamp(mat.color.r + 1.0f, 0, 2); float elapsedTime = 0; StopCoroutine(eggParameter.ChangeColorVar); while (elapsedTime < 5) { mat.color = Color.Lerp(mat.color, new Color(heatRed, mat.color.g, mat.color.b, 1), elapsedTime / 5); elapsedTime += Time.deltaTime; yield return(new WaitForEndOfFrame()); } eggParameter.AddParameter(0, 5, 0); elapsedTime = 0; exHandler.Expression(exHandler.hot, 1.0f); yield return(new WaitForSeconds(1)); while (elapsedTime < 1) { rg.AddRelativeForce(new Vector3(0, 30, 0)); elapsedTime += Time.deltaTime; yield return(new WaitForEndOfFrame()); } }
// Update is called once per frame void Update() { //x += Input.GetAxis("Horizontal"); //y += Input.GetAxis("Vertical"); //transform.localPosition = new Vector3(x, y, initialPosition.z); rotX = Input.GetAxis("Vertical") * RotationGain; rotY = Input.GetAxis("Horizontal") * RotationGain; transform.parent.gameObject.GetComponent <Rigidbody>().AddTorque(new Vector3( rotY, rotX, 0)); #region Testing Expressions //Testing Expressions if (Input.GetKeyDown(KeyCode.A)) { exHandler.Expression(exHandler.question); } if (Input.GetKeyDown(KeyCode.S)) { exHandler.Expression(exHandler.sweat); } if (Input.GetKeyDown(KeyCode.D)) { exHandler.Expression(exHandler.notice); } if (Input.GetKeyDown(KeyCode.D)) { exHandler.Expression(exHandler.notice); } if (Input.GetKeyDown(KeyCode.Z)) { faceHandler.Expression(faceHandler.blush); } //----end of Testing Expressions---- #endregion if (Input.GetKeyDown(KeyCode.Q)) { eggParameter.AddParameter(10, 0, 0); UpdateParameterText(); } if (Input.GetKeyDown(KeyCode.W)) { eggParameter.AddParameter(0, 10, 0); UpdateParameterText(); } if (Input.GetKeyDown(KeyCode.E)) { eggParameter.AddParameter(0, 0, 10); UpdateParameterText(); } if (Input.GetKeyDown(KeyCode.R)) { eggParameter.ResetParameter(); UpdateParameterText(); } if (Input.GetKeyDown(KeyCode.T)) { RestartEgg(); } }