Hi there! I know a decent amount of C# and scripting in unity, but I’m still a bit new to it all.
How the Game Works:
So the game that i am creating is essentially a Social Media Simulator type of thing (Channel Simulator is the working title) where players will create content and upload it to the internet. The players create content by choosing a category, then using some method to choose how much time is spent on each part of the content (i.e. videos quality, sound quality, etc. (more to be unlocked as the game progresses)). Based on their choices, the game will calculate a percent (number between 0 and 1). I have all of this pretty much figure out, but what i don’t have figured out is the process after their content is created.
What I’m Wanting to do:
After the players content is created, he/she will begin to receive feedback via comments, views, likes/dislike, etc. Here is the script I have created that will generate a positive comment (I know this isn’t the most efficient way of doing things):
using UnityEngine;
using System.Collections;
public class PositiveCommentsGenerator : MonoBehaviour {
public static string[] comments;
// Use this for initialization
void Start () {
int comment = Random.Range(0, 20);
string[] comments = new string[50];
comments[0] = "i laughed so hard my abs hurt! Haha.";
comments[1] = "I'm looking forward to your next video!";
comments[2] = "cool vid!";
comments[3] = "Hey wutz up guyz!";
comments[4] = "I love it!";
comments[5] = "Nice video and inspiring...keep up the good work and hey...well done";
comments[6] = "Truly Awesome and Completely Amazing Video....";
comments[7] = "very cool video";
comments[8] = "Very nice video! Keep it up!";
comments[9] = "Hello, how’s it going? Just shared this post with a colleague, we had a good laugh.";
comments[10] = "I really enjoyed this! keep up the great work, :)";
comments[11] = "Shared this with my friends!";
comments[12] = "I just want to say this video si great.";
comments[13] = "You're so inspiring";
comments[14] = "I look foward to these everyday.";
comments[15] = "I really like the fact that you put so much effort into this video";
comments[16] = "Your content is my favorite!";
comments[17] = "your vids really help me every day!";
comments[18] = "your videos really entertain me :D";
comments[19] = "i listen to your videos when I go to sleep";
Debug.Log(comments[comment]);
}
// Update is called once per frame
void Update () {
}
}
I have this script attached to a Prefab, and when i need to generate a comment, I instantiate that Prefab, thus generating a comment. My question is, how can I store this newly generated comment globally so that the next time the Comment generator is run, it doesn’t override the previous comment? Sorry if I’m not explaining this very well, but any and all suggestions are very much appreciated!
-Serentix