protected void Begin() { PlayerMovements.isPlayerInputEnable = false; VD.OnNodeChange += UpdateUI; VD.OnEnd += End; VD.BeginDialogue(GetComponent <VIDE_Assign>()); VD.SetNode(HorseState.GET_STATE()); }
protected void Start() { container_NPC = GameObject.FindGameObjectWithTag("dialog_window"); text_NPC = GameObject.FindGameObjectWithTag("dialog_text").GetComponent <Text>(); image_NPC = GameObject.FindGameObjectWithTag("dialog_image").GetComponent <Image>(); container_NPC.SetActive(false); text_NPC.text = ""; currentDialogState = HorseState.GET_STATE(); }
// Start is called before the first frame update void Start() { animator = GetComponent <Animator>(); currentState = HorseState.Preparing; Horse = GetComponent <Rigidbody2D>(); runStarted = true; Aceleration = 0f; nameChange = 0; lastChange = 0; }
private void Followed() { if (Owner == null) { return; } State = HorseState.Follow; float[] randoms = new float[2].Select(x => Random.Range(-6f, 6f)).ToArray(); setPoint = Owner.baseT.position + Vectors.right * randoms[0] + Vectors.forward * randoms[1]; setPoint.y = GetHeight(setPoint + Vectors.up * 5f); awayTimer = 0f; }
private void OnTriggerEnter2D(Collider2D collision) { cameraController.target = this.gameObject; if (currentDialogState != HorseState.GET_STATE()) { dialog_over = false; currentDialogState = HorseState.GET_STATE(); } if (!VD.isActive && !dialog_over) { Begin(); } }
// Use this for initialization void Start() { m_CurrentState = HorseState.e_Emerging; m_InitialAngleX = transform.localEulerAngles.x; if(m_InitialAngleX > 180.0f && m_InitialAngleX <= 360.0f) { m_InitialAngleX = m_InitialAngleX - 360.0f; } m_InitialLocalX = transform.localPosition.x; m_InitialLocalY = transform.localPosition.y; }
public override void Action() { base.Action(); if (isActive_cigaretsQuest) { if (cigaretsQuest.isQuestPass && !cigaretsQuest.isQuestCanceld) { HorseState.SET_STATE(HorseState.State.CIGARETS); } else if (!cigaretsQuest.isQuestPass && cigaretsQuest.isQuestCanceld) { HorseState.SET_STATE(HorseState.State.NO_CIGARETS); } npcMemory.AddQuestMemory(cigaretsQuest); } }
// Update is called once per frame void Update() { if (HorseState.GET_STATE_RAW() == HorseState.State.HELLO) { animator.SetBool("smoking", false); } else if (HorseState.GET_STATE_RAW() == HorseState.State.CIGARETS) { animator.SetBool("smoking", true); } else if (HorseState.GET_STATE_RAW() == HorseState.State.NO_CIGARETS) { if (!_isAngryPlayed) { animator.Play("angry1"); _isAngryPlayed = true; } animator.SetBool("smoking", false); } }
public void Unmounted() { this.State = HorseState.Idle; base.gameObject.GetComponent <TITAN_CONTROLLER>().enabled = false; }
public void Mounted() { this.State = HorseState.Mounted; base.gameObject.GetComponent <TITAN_CONTROLLER>().enabled = true; }
// Update is called once per frame void Update() { if(m_IsRunning) { switch(m_CurrentState) { case HorseState.e_Emerging: { transform.position += Vector3.up * m_VerticalSpeed * Time.deltaTime; float heightPercentage = (transform.localPosition.y - m_InitialLocalY) / (- m_InitialLocalY); Vector3 newLocalEulerAngles = transform.localEulerAngles; newLocalEulerAngles.x = Mathf.Lerp (m_InitialAngleX, 0.0f, heightPercentage); transform.localEulerAngles = newLocalEulerAngles; if(transform.localPosition.y >= 0.0f) { Vector3 newLocalPosition = transform.localPosition; newLocalPosition.y = 0.0f; transform.localPosition = newLocalPosition; m_CurrentState = HorseState.e_Running; } } break; case HorseState.e_Running: { transform.position += transform.forward * m_Speed * Time.deltaTime; if(Mathf.Abs (transform.localPosition.x) > Mathf.Abs (m_InitialLocalX)) { m_CurrentState = HorseState.e_Sinking; } } break; case HorseState.e_Sinking: { transform.position -= Vector3.up * m_VerticalSpeed * Time.deltaTime; float heightPercentage = (transform.localPosition.y - m_InitialLocalY) / (- m_InitialLocalY); Vector3 newLocalEulerAngles = transform.localEulerAngles; newLocalEulerAngles.x = Mathf.Lerp (- m_InitialAngleX, 0.0f, heightPercentage); if(transform.localPosition.y <= m_InitialLocalY) { Vector3 newLocalPosition = transform.localPosition; newLocalPosition.x = m_InitialLocalX; newLocalPosition.y = m_InitialLocalY; transform.localPosition = newLocalPosition; newLocalEulerAngles.x = m_InitialAngleX; if(m_LastTurn) { m_IsRunning = false; } else { m_CurrentState = HorseState.e_Emerging; } } transform.localEulerAngles = newLocalEulerAngles; } break; } } else { if(m_StartTimer > 0.0f) { m_StartTimer -= Time.deltaTime; if(m_StartTimer <= 0.0f) { m_IsRunning = true; } } } }