- Home /
Question by
unity_YBW262B1IWmeXw · May 18, 2018 at 11:05 AM ·
scripting beginnerrandomizeswitch scenesswitch characters
I am Random Generating heroes, but how do I code so that the computer know to use which corresponding H&B for specific scene?
I can Random Generating heroes, although I haven't written down the code yet but I able to create a list to store the head and body.
using System.Collections.Generic;
using UnityEngine;
using Funj.Stat;
public class GuildRecruitDesign : MonoBehaviour {
public List<ScriptableObject> heads = new List<ScriptableObject>();
public List<ScriptableObject> bodies = new List<ScriptableObject>();
}
In each ScriptableObject, I able to store two sprites in order to match their design and colour for different scenes.
[CreateAssetMenu]
public class Head : ScriptableObject
{
public Sprite Mhead;
public Sprite Ehead;
}
[CreateAssetMenu]
public class Body : ScriptableObject
{
public Sprite Mbody;
public Sprite Ebody;}
During a turn, the player get to explore around town (pokemon style looking sprite)(i.e: Ehead and Ebody) for shopping, recruitment, etc. At the end of the turn, the player will switch scene where he or she will undergo a mission(megamen looking sprite)(i.e: Mhead and Mbody). How am I able to switch two looking sprite for two different scenes? Can anyone help me for this problem because i pretty new in coding in c# and unity?
Comment