Ch 5, NPC's and the ScriptableObject

Home Forums Books Mastering Unity 2D Game Development Ch 5, NPC's and the ScriptableObject

This topic contains 1 reply, has 2 voices, and was last updated by  CS 3 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4275

    Quick note about a bug in Ch5 which wasn’t apparent until Unity fixed it.

    It used to be possible to use ScriptableObjects as classes on a GameObject, the same way as a MonoBehaviour.

    I’ve updated the section in the book and replaced the NPC script with the following:

    using UnityEngine;

    public class Npc : MonoBehaviour

    {

    public string Name;

    public int Age;

    public string Faction;

    public string Occupation;

    public int Level;

    }

     

    That should enable you to continue on with the book.  Full text explaining the change will be in the updated version.

    Simon (Darkside) Jackson
    @SimonDarksideJ

    #4391

    CS

    Have you report this bug to Unity?

Viewing 2 posts - 1 through 2 (of 2 total)

The forum ‘Mastering Unity 2D Game Development’ is closed to new topics and replies.