Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - damon00

Pages: [1]
1
I got it working, thanks!!  :D

2
BTW, I don't know if this is relevant or not, but I am currently using the default windows cursor in my project. In other words I haven't done anything with the cursor before this.

3
Ok, I think I'm getting close, but still missing something...

I'm now no longer getting any errors, but the cursor still doesn't change.

Here's my code now:
  1. public class UI_Player_Inventory_Slot : MonoBehaviour {
  2.  
  3.         public int slot;
  4.  
  5.         UIAtlas mAtlas;
  6.  
  7.  
  8.         // Use this for initialization
  9.         void Start () {
  10.                
  11.         }
  12.  
  13.         void Awake ()
  14.         {
  15.                 mAtlas = GetComponent<UIAtlas> ();
  16.         }
  17.        
  18.         // Update is called once per frame
  19.         void Update () {
  20.        
  21.         }
  22.  
  23.         void OnClick ()
  24.         {
  25.                 Debug.Log ("inventory slot clicked");
  26.                 Game_Manager.Player_Inventory_Slots [slot].item_id = 1;
  27.  
  28.                 if (Game_Manager.Player_Inventory_Slots [slot].item_id > 0)
  29.                 {
  30.                         //pickup item
  31.                         Game_Manager.held_item = Game_Manager.Player_Inventory_Slots [slot].item_id;
  32.                         Game_Manager.Player_Inventory_Slots [slot].item_id = 0;
  33.  
  34.                         UICursor.Set(mAtlas,"Book_00");
  35.                 }
  36.         }
  37. }
  38.  

Any ideas on what I'm missing?

4
Thanks ArenMook, I'll give that a try!

5
Here's my code:

UICursor.Set(UIAtlas,"Book_00");

My atlas is called MainHUD, and I made it using the Atlas Maker, but I don't know how to reference it in UICursor.Set.

I've looked at every bit of example code I could find, including the InventorySystem example, and I still don't understand this one part.

If anyone could explain it to me I would greatly appreciate it!!!

Pages: [1]