Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Cool idea the game jam ended months ago and i am working on this game full time so i am open to ideas for the dialogue!

So how you're doing dialog, with arrays or not?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class CharacterInnerThoughts : MonoBehaviour
{
    public Text textDisplay;

    public string[] sentences;

    private int index;

    public float speed;

    public float destroyTime;

    public GameObject theCanvas;

    IEnumerator Type()
    {
        foreach(char letter in sentences[index].ToCharArray())
        {
            textDisplay.text += letter;
            yield return new WaitForSeconds(speed);
             RemoveText();
        }
    }

    void OnTriggerEnter2D(Collider2D col)
    {
        if(col.gameObject.tag == "Player")
        {
            StartCoroutine(Type());
        }
    }

    void RemoveText()
    {
        Destroy(textDisplay, destroyTime);
        Destroy(theCanvas, destroyTime);
    }
}

(1 edit)

Because with arrays that would be more comfortable. If you want I can write a script, and send you it.

Yeah would that be easier or not?

So I guess this is a one time use script, because you destroy the objects?

It could be used multiple times.

Yeah i usually just attach the script to more than one gameObject

You know, you could have one object, and multiple diouloges. I could write the code and send it to you.

So should I write and send it to you, or try to explain it to you?

If write and send it to you, I'll leave comments in the script, so you would understand it. :)

Just wanting to help.

Yeah thanks if you don't mind also at some point when the first part of the game is done could i send it to you for playtesting?

Yes, I can playtest your game, that's just fair, because you're Playtesting my game. So yeah, I can playtest it. :)

Thanks i think in the next couple weeks i will have level 1-10 done if you'd be able to look at them?

Yes, just send the Google Drive link here, when I will download it I will write that here and you'll delete it from the drive, so I could only access it.

I could share my e-mail, but I don't want to get spams, because I know, there's some people who like doing that. :(

(1 edit)

Here's the code: https://drive.google.com/file/d/1w7wA0ZgzTczIuiYd-LKEi-o3tQZGH81e/view?usp=shari...

It's a UnityPackage


Explanations are in the code as comments, if you need help with any other code, just ask. There are two scripts, and both of them are needed, if you need help setting it up, I can record my screen and send you the video. :)

Thanoyu i appreciate it :)

If you need help with any other code, just ask. :)

Is my code working in your game?