https://www.youtube.com/watch?v=3ICLvlIsn6w
I am trying to add new cursors on mouse hover for Intractable NPCs (you can open dialogue with these npcs in future) and Friendly NPCs (where cursor just turns to green, they just exist in the world). In Utility.cs I went ahead and added two additional enums as follows.
public enum Layer
{
Walkable = 8,
Enemy = 9,
NPCInteract = 10,
NPCFriendly = 11,
RaycastEndStop = -1
}
New tags were created in Layer 10 and 11
So in CursorAffodance.cs the switch statement was updated to
void OnDelegateCalled (Layer newLayer) {
switch(newLayer)
{
case Layer.Walkable:
Cursor.SetCursor(walkCursor, cursorHotspot, CursorMode.Auto);
break;
case Layer.Enemy:
Cursor.SetCursor(targetCursor, cursorHotspot, CursorMode.Auto);
break;
case Layer.NPCInteract:
Cursor.SetCursor(npcInteractCursor, cursorHotspot, CursorMode.Auto);
//Debug.LogError("On NPC");
break;
case Layer.NPCFriendly:
Cursor.SetCursor(npcFriendlyCursor, cursorHotspot, CursorMode.Auto);
break;
case Layer.RaycastEndStop:
Cursor.SetCursor(unknownCursor, cursorHotspot, CursorMode.Auto);
break;
default:
Debug.LogError("Dont know what cursor to show!");
return;
}
}
New cursors were attached/assigned as required
And this NPC is tagged with the appropriate tag
Now, I have to mention that to create this NPC I skipped ahead and watched
Lecture 54. Importing Humanoid Animations of Section 2, Importing Humanoids. I followed steps in the video and changed an enemy character into this new humanoid. Now when I retag the NPC as an enemy the cursor changes to the assigned enemy cursor, but with the newly created NPC layer, no change happens. What am I missing in this case, as this new humaniod npc seems to have cursor working for the enums that were created in the course, but my own additions dont seem to take change.