public void NextDialog() { if (DialogSystem.GetDialogSystem().GetSetDialogStart == true) { currText++; if (currText > dialogTexts.Count - 1) { hiding = true; return; } uiText.text = dialogTexts[currText]; } }
void Update() { if (!DialogSystem.GetDialogSystem().GetSetDialogStart) { BaseLogic(); } else { StopAllAnimation(); curSpeed = 0.0f; rigidBody.velocity = new Vector2(0.0f, 0.0f); } }
void Start() { uiText = this.gameObject.GetComponentInChildren <Text>(); startPosY = this.transform.localPosition.y; uiText.text = ""; dialogSystem = DialogSystem.GetDialogSystem(); showing = false; showingTimer = 0; hiding = false; hidingTimer = 0; }
private void Hide() { hidingTimer += Time.deltaTime; if (hidingTimer < hidingTime) { float p = hidingTimer / hidingTime; this.transform.localPosition = new Vector3(this.transform.localPosition.x, startPosY * p + destY * (1.0f - p), 0.0f); } else { hiding = false; hidingTimer = 0; this.transform.localPosition = new Vector2(this.transform.localPosition.x, startPosY); } DialogSystem.GetDialogSystem().GetSetDialogStart = false; }
private void Show() { showingTimer += Time.deltaTime; if (showingTimer < showingTime) { float p = showingTimer / showingTime; this.transform.localPosition = new Vector3(this.transform.localPosition.x, destY * p + startPosY * (1.0f - p), 0.0f); } else { showing = false; showingTimer = 0; this.transform.localPosition = new Vector2(this.transform.localPosition.x, destY); } DialogSystem.GetDialogSystem().GetSetDialogStart = true; }