Advertisement
baldio99codderboi

Untitled

Jul 27th, 2022
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.33 KB | None | 0 0
  1. // GameControllerScript
  2. // Token: 0x06000B1C RID: 2844
  3. public void Add2ItemSlots()
  4. {
  5. this.item = new int[5];
  6. RectTransform component = GameObject.Find("ItemBG").GetComponent<RectTransform>();
  7. component.anchoredPosition = new Vector3(component.anchoredPosition.x - 2.6f, component.anchoredPosition.y - 9f);
  8. component.localScale = new Vector3(component.localScale.x + 0.77f, component.localScale.y - 0.36f, component.localScale.z);
  9. this.itemSelect.localScale = new Vector3(this.itemSelect.localScale.x + 0.14f, this.itemSelect.localScale.y - 0.36f, this.itemSelect.localScale.z);
  10. GameObject gameObject = UnityEngine.Object.Instantiate<GameObject>(GameObject.Find("ItemSlot0"));
  11. GameObject gameObject2 = UnityEngine.Object.Instantiate<GameObject>(GameObject.Find("ItemSlot0"));
  12. gameObject.gameObject.name = "ItemSlot3";
  13. gameObject2.gameObject.name = "ItemSlot4";
  14. gameObject.transform.SetParent(GameObject.Find("Hud").transform);
  15. gameObject2.transform.SetParent(GameObject.Find("Hud").transform);
  16. gameObject.GetComponent<RectTransform>().anchoredPosition = new Vector3((float)this.itemSelectOffset[0], GameObject.Find("ItemSlot0").GetComponent<RectTransform>().anchoredPosition.y, 0f);
  17. gameObject2.GetComponent<RectTransform>().anchoredPosition = new Vector3((float)this.itemSelectOffset[1], GameObject.Find("ItemSlot0").GetComponent<RectTransform>().anchoredPosition.y, 0f);
  18. gameObject.GetComponent<RectTransform>().localScale = this.itemSlot[0].GetComponent<RectTransform>().localScale;
  19. gameObject2.GetComponent<RectTransform>().localScale = this.itemSlot[0].GetComponent<RectTransform>().localScale;
  20. gameObject.GetComponent<Transform>().rotation = Quaternion.identity;
  21. gameObject2.GetComponent<Transform>().rotation = Quaternion.identity;
  22. RawImage[] array = this.itemSlot;
  23. this.itemSlot = new RawImage[5];
  24. this.itemSlot[0] = gameObject.GetComponent<RawImage>();
  25. this.itemSlot[1] = gameObject2.GetComponent<RawImage>();
  26. this.itemSlot[2] = array[0];
  27. this.itemSlot[3] = array[1];
  28. this.itemSlot[4] = array[2];
  29. Texture2D texture2D = ModExtraAssets.Get<Texture2D>("ItemSlot5");
  30. GameObject.Find("ItemSlots").GetComponent<RawImage>().texture = texture2D;
  31. GameObject.Find("ItemText").GetComponent<RectTransform>().anchoredPosition = new Vector2(GameObject.Find("ItemText").GetComponent<RectTransform>().anchoredPosition.x, GameObject.Find("ItemText").GetComponent<RectTransform>().anchoredPosition.y + 20f);
  32. GameObject.Find("ItemText").GetComponent<RectTransform>().sizeDelta = new Vector2((float)texture2D.width, GameObject.Find("ItemText").GetComponent<RectTransform>().sizeDelta.y);
  33. GameObject.Find("ItemSlots").GetComponent<RectTransform>().sizeDelta = new Vector2((float)texture2D.width, (float)texture2D.height);
  34. GameObject.Find("ItemSlots").GetComponent<RectTransform>().anchoredPosition = new Vector2(GameObject.Find("ItemSlots").GetComponent<RectTransform>().anchoredPosition.x + 45f, GameObject.Find("ItemSlots").GetComponent<RectTransform>().anchoredPosition.y + 7f);
  35. this.itemSelect.anchoredPosition = new Vector3((float)this.itemSelectOffset[0] - 3.5f, -8.1f, 0f);
  36. foreach (RawImage rawImage in UnityEngine.Object.FindObjectsOfType<RawImage>())
  37. {
  38. if (rawImage.gameObject.name.Contains("ItemSlot") && rawImage.gameObject.name != "ItemSlots")
  39. {
  40. rawImage.gameObject.GetComponent<RectTransform>().anchoredPosition = new Vector2(rawImage.gameObject.GetComponent<RectTransform>().anchoredPosition.x - 6f, rawImage.gameObject.GetComponent<RectTransform>().anchoredPosition.y - 1f);
  41. rawImage.gameObject.GetComponent<RectTransform>().sizeDelta = new Vector3(rawImage.gameObject.GetComponent<RectTransform>().sizeDelta.x - 1.5f, rawImage.gameObject.GetComponent<RectTransform>().sizeDelta.y - 1.5f);
  42. }
  43. }
  44. GameObject.Find("ItemSlot0").GetComponent<RectTransform>().anchoredPosition = new Vector3((float)this.itemSelectOffset[2] - 6f, GameObject.Find("ItemSlot0").GetComponent<RectTransform>().anchoredPosition.y, 0f);
  45. GameObject.Find("ItemSlot1").GetComponent<RectTransform>().anchoredPosition = new Vector3((float)this.itemSelectOffset[3] - 6f, GameObject.Find("ItemSlot0").GetComponent<RectTransform>().anchoredPosition.y, 0f);
  46. GameObject.Find("ItemSlot2").GetComponent<RectTransform>().anchoredPosition = new Vector3((float)this.itemSelectOffset[4] - 6f, GameObject.Find("ItemSlot0").GetComponent<RectTransform>().anchoredPosition.y, 0f);
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement