public void Emit(RocketSlot slot, SlotEvent type) { if (OnRocketSlotAction != null) { OnRocketSlotAction(slot, type); } }
public void Activate(SlotEvent slotEvent) { assets.tweens.tsBonus.Play(); assets.audioBonus.Play(); this.slotEvent = slotEvent; gameObject.SetActive(true); bonusSlot.Activate(); }
void OnTriggerExit(Collider collision) { if (collision.gameObject.CompareTag("Player") && slotType == SlotType.Occupied) { slotType = SlotType.Available; toggleSlotAvailiability(slotType); SlotEvent?.Invoke(this, new SlotEventArgs(this.GetComponent <Slot>())); } }
void OnTriggerEnter(Collider collision) { if (collision.gameObject.CompareTag("Player")) { Debug.Log("PARKED at " + this.gameObject.name); slotType = SlotType.Occupied; toggleSlotAvailiability(slotType); SlotEvent?.Invoke(this, new SlotEventArgs(this.GetComponent <Slot>())); } }
private void Workshop_OnRocketSlotAction(RocketSlot slot, SlotEvent type) { if (type == SlotEvent.Activated) { Start(); } if (type == SlotEvent.Empied || type == SlotEvent.Filled) { workshop.Emit(Ready ? RocketEventsTypes.Ready : RocketEventsTypes.Incomplete); } }
private void Workshop_OnRocketSlotAction(RocketSlot slot, SlotEvent type) { if (state == StoreItemEvents.Drag) { if (type == SlotEvent.Hover) { if (slot.itemType == itemType) { this.slot = slot; } } else if (type == SlotEvent.Exit && slot == this.slot) { this.slot = null; } } }
public Player(string name, Vector2 pos) : base(name) { slotEvent = new SlotEvent(); selectedSlot = 0; GameObject prefab = Resources.Load("Prefabs/" + name) as GameObject; inventory = new Inventory(INVENTORY_SIZE + HOTBAR_SIZE, 4, "Inventory"); inventory.AddItem(new ItemStack(ItemData.PICKAXE, 1)); inventory.AddItem(new ItemStack(ItemData.SHOVEL, 1)); inventory.AddItem(new ItemStack(ItemData.WOOD, 75)); inventory.AddItem(new ItemStack(ItemData.WORKBENCH, 10)); entityObject = PlayerController.Instantiate(prefab, pos, Quaternion.identity); controller = entityObject.GetComponent <PlayerController>(); controller.AddSlotListener(HeldItemChangeEvent); controller.AddOnAttackListener(OnAttack); controller.AddOnInteractListener(OnInteract); controller.AddReleaseAttackListener(ReleaseAttack); controller.AddReleaseInteractListener(ReleaseInteract); controller.AddMouseMoveEvent(MouseChangePosition); }