コード例 #1
0
        public bool active;                              // gui is active

        /// <summary>
        /// Initialize all components
        /// </summary>
        void Start()
        {
            guiHotbar       = GetComponent <GuiHotbar>();
            containerHotbar = GetComponent <ContainerHotbar>();

            guiPlayerInventory       = GetComponent <GuiInventory>();
            containerPlayerInventory = GetComponent <ContainerSlots>();

            containerCursor = GetComponent <ContainerCursor>();

            player = GetComponent <EntityPlayer>();
        }
コード例 #2
0
 /// <summary>
 /// Open or close the gui
 /// </summary>
 /// <param name="open"></param>
 private void setGuiOpen(bool open)
 {
     if (!open)
     {
         resetOther();
     }
     else
     {
         if (player.LookObject != null && player.LookObject.GetComponent <ContainerSlots>() != null)
         {
             containerOtherInventory = player.LookObject.GetComponent <ContainerSlots>();
             guiOtherInventory       = player.LookObject.GetComponent <GuiInventory>();
         }
     }
     this.active    = open;
     Cursor.visible = open;
 }
コード例 #3
0
 /// <summary>
 /// Reset the other inventory to nothing
 /// </summary>
 public void resetOther()
 {
     this.guiOtherInventory       = null;
     this.containerOtherInventory = null;
 }
コード例 #4
0
 /// <summary>
 /// Set the other inventory the player interact with
 /// </summary>
 /// <param name="gui"></param>
 /// <param name="container"></param>
 public void setOther(GuiInventory gui, ContainerSlots container)
 {
     this.guiOtherInventory       = gui;
     this.containerOtherInventory = container;
 }