Search Unity

ScriptableObject data into Array

Discussion in 'Getting Started' started by OdaBaX, Aug 12, 2019.

  1. OdaBaX

    OdaBaX

    Joined:
    Jun 15, 2018
    Posts:
    2
    I have a ScriptableObject called "Player".
    Player has :
    int Number;
    string Name;

    I would like to put this information into an Array and print it out in Debug.Log();
    Any help that could point me in the right direction :)
     
  2. OdaBaX

    OdaBaX

    Joined:
    Jun 15, 2018
    Posts:
    2
    public Player[] player;

    foreach (Player i in player)
    {
    Debug.Log(i.Name);
    Debug.Log(i.Number);