Exemplo n.º 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>();
        }
Exemplo n.º 2
0
        public override void onConstruct()
        {
            base.onConstruct();

            this.mainCamera = Camera.main.transform;

            this.dataHotbar    = new ContainerData(9, 1);
            this.dataInventory = new ContainerData(5, 5);

            this.contManager = Main.singleton.containerManager;

            this.containerHotbar = ContainerManager.containerHotbar;
            this.containerHotbar.onOpen(this.dataHotbar, this);

            this.playerMover      = new PlayerMover(this);
            this.blockBreakEffect = GameObject.Instantiate(References.list.blockBreakEffect).GetComponent <BreakBlockEffect>();
            this.wsTooltip        = GameObject.Instantiate(References.list.worldSpaceTooltipPrefab).GetComponent <WorldSpaceToolTip>().setPlayer(this);

            this.setMaxHealth(100);
            this.setShadow(0.75f, 0.6f);
        }