public void DeselectPart() { SelectedDisplay.SetActive(false); selectedPart = null; partsavaliablebyprefix = null; indexOfPartbyPrefix = 0; }
public void Trigger(InputAction.CallbackContext context) { if (context.performed) { GolemSlot selected = null; Ray ray = mainCamera.ScreenPointToRay(Mouse.current.position.ReadValue()); if (!UIHelper.Instance.IsPointerOverUIElement()) { RaycastHit hit; if (Physics.Raycast(ray, out hit)) { Debug.Log(hit.collider.name); if (hit.collider.gameObject.GetComponent <GolemSlot>()) { selected = hit.collider.gameObject.GetComponent <GolemSlot>(); Debug.Log("Clicked On " + selected.part.ToString()); GolemBuilderUIManager.Instance.UpdateMenu(selected); } } else { Debug.Log("Clicked On None"); GolemBuilderUIManager.Instance.DeselectPart(); } } } }
public void UpdateMenu(GolemSlot selectedPart) { partsavaliablebyprefix = new List <string> { "ChiseledGrey", "ChiseledLight", "Ruby" }; // change this to get from inventory; // Load avaliable peices for that location indexOfPartbyPrefix = partsavaliablebyprefix.IndexOf(selectedPart.currentPartName); UpdateSelectedText(); SelectedDisplay.SetActive(true); }
public void ChangeBodyPart(GolemSlot.eLocation part, string meshNamePrefix) { GolemSlot slot = GolemSlots.Where(m => m.part == part).FirstOrDefault(); Mesh mesh = MeshList.Where(m => m.name.Contains(meshNamePrefix) && m.name.ToUpper().Contains(part.ToString())).FirstOrDefault(); if (slot && mesh) { slot.UpdateBodyData(mesh); SaveGolem(); } }
public void UpdatePart(GolemSlot currentpart, string meshNamePrefix) { golem.ChangeBodyPart(currentpart.part, meshNamePrefix); }