/** TODO * - zeby loot dalo sie zebrac dopiero jak upadnie z pociagu na ziemie * - zeby nie dalo sie wchodzic na pociag * - zeby w okienku na gorze bylo widac ikonki typow lootu i ile ich mamy * - zeby player ginal przy zderzeniu z pociagiem */ void OnTriggerStay(Collider collider) { Debug.Log(collider.name); if (collider.tag == "Pickable") { Debug.Log("pickable"); if (Input.GetButton("Use")) { GameObject itemObject = collider.transform.gameObject; AbsPickable pickable = collider.GetComponentInParent <AbsPickable> (); if (pickable is AbsItem) { bool wasItemPickedUp = inventoryBuilder.AddItemToInventory(itemObject); if (wasItemPickedUp) { pickable.OnBeingPicked(); InfoPanelManager.AddNewMessage(Strings.pickUpItem + pickable.GetName()); } } } AbsLoot loot = collider.GetComponentInParent <AbsLoot> (); if (loot != null) { Debug.Log("with loot"); loot.OnBeingPicked(); lootInventoryBuilder.PutLoot(loot); InfoPanelManager.AddNewMessage(Strings.pickUpLoot + loot.GetName()); } } }
private void OnDestroy() { if (this == sInstance) { sInstance = null; } }
public UiMaster(ContentManager cm) { functions = Parsers.Parsers.Parse_InternalGridMenu(@"Content/UI/internal_ui.txt"); elements = Parsers.Parsers.Parse_Ui_Master(@"Content/UI/ui_master.txt", cm); action_queue = new List <ButtonFunction>(); isActive = true; messenger = new Messenger(new Vector2(1920 / 2, 864)); infoManager = new InfoPanelManager(infoPosition, 100); }
void Awake() { if (sInstance == null) { sInstance = this; Setup(); } else if (sInstance != this) { Destroy(this.gameObject); return; } }
void Start() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(this); } Ticker.OnTickEvent += UpdateUI; }
// Use this for initialization void Start() { if (GameObject.Find("BagSystem") != null) { canvas = GameObject.Find("BagSystem").GetComponent <RectTransform>(); } InfoPanel = GameObject.Find("InfoPanel"); if (InfoPanel != null) { infoPanelManager = InfoPanel.GetComponent <InfoPanelManager>(); } //else //{ // Debug.Log("infoPanel为空"); //} }
// Use this for initialization void Start() { job_queue = new SimplePriorityQueue <Job>(); in_progress_jobs = new List <Job>(); item_yield_stats = GetComponent <ItemYieldStats>(); var pauser = GameObject.Find("GamePauser"); pause_game_control = pauser.GetComponent <PauseGame>(); var info_panel = GameObject.Find("InfoPanel"); info_panel_manager = info_panel.GetComponent <InfoPanelManager>(); GameObject map_gen_game_object = GameObject.Find("MapGenerator"); if (map_gen_game_object != null) { map_generator = map_gen_game_object.GetComponent <MapGenerator>(); } }
private void Awake() { GameObject obj = GameObject.FindGameObjectWithTag("Player"); thisCamera = obj.GetComponentInChildren <Camera>(); rayCaster = GetComponentInParent <GraphicRaycaster>(); eventData = new PointerEventData(null); infoPanelManager = transform.GetComponentInChildren <InfoPanelManager>(); infoPanelManager.gameObject.SetActive(false); // set trash to false Trash = transform.Find("Trash").gameObject; Trash.SetActive(false); SystemControls.HudStateChange += OnHudChange; SystemControls.ClickDown += BeginDrag; SystemControls.ClickUp += EndDrag; loadout = GameObject.FindGameObjectWithTag("Loadout").GetComponent <LoadoutManager>(); CurrentHover = null; }
public void RemoveItemFromInventory(AbsItem item) { InfoPanelManager.AddNewMessage(Strings.dropItem + item.GetName()); if (leftHand.GetComponent <InventoryButtonScript>().GetAssociatedItem() == item) { RemoveAssociatedItemFromHand(leftHand); } if (rightHand.GetComponent <InventoryButtonScript>().GetAssociatedItem() == item) { RemoveAssociatedItemFromHand(rightHand); } foreach (GameObject itemObject in pickedUpObjects) { if (itemObject.GetComponent <AbsItem>() == item) { itemObject.GetComponent <AbsItem>().OnBeingThrown(); itemObject.transform.SetParent(null, true); pickedUpObjects.Remove(itemObject); return; } } }
private void Start() { infoPanelManager = FindObjectOfType <InfoPanelManager>(); handOfGod = new HandOfGod(); }