Welcome to GEMENTAR TOUR PUO V2 Development Documentation. Enjoy your stay!

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:class_diagram [2022/07/25 16:38] – [Building Interact] adminwiki:class_diagram [2022/07/27 16:48] (current) admin
Line 1: Line 1:
 + --- //[[admin@puov2.gementar.com|Hilmi]] 2022/07/25 16:42//
 ====== Class Diagram ====== ====== Class Diagram ======
  
Line 125: Line 126:
 </code> </code>
  
-;#; +
-** EVERY METHOD EXPLAINATION **+
  
  
Line 141: Line 141:
 Refresh method calls Delete() and ShowsList(), this come in handy when want to refresh those list. Refresh method calls Delete() and ShowsList(), this come in handy when want to refresh those list.
 </file> </file>
-;#; 
  
 ===== Building Interact ===== ===== Building Interact =====
Line 423: Line 422:
  
  
-===== Building Interact =====+===== Bangunan (SCRIPTABLE OBJECT) =====
  
 <code CSharp | Full Script> <code CSharp | Full Script>
-using Sirenix.OdinInspector; 
 using System.Collections; using System.Collections;
 using System.Collections.Generic; using System.Collections.Generic;
-using TMPro; 
 using UnityEngine; using UnityEngine;
 +using Sirenix.OdinInspector;
  
-public class BuildingInteract MonoBehaviour+#region Code Information 
 +/* 
 +   This is a scriptable object. make sure to put x/z location to the pivot of camera Rig 
 + */ 
 +#endregion 
 + 
 +[CreateAssetMenu(fileName = "DataBangunan", menuName ="Data Bangunan")] 
 +public class Bangunan ScriptableObject
 { {
-    public enum SenaraiBangunan +    [BoxGroup("Informasi Bangunan")] 
-    { +    public string namaBangunan; 
-        _1_pusat_islam = 0, +    [BoxGroup("Informasi Bangunan")] 
-        _2_anjung_premier = 1, +    [TextArea] 
-        _3_cisec = 2, +    public string namaPenuhBangunan; 
-        _4_dewan_jka = 3+    [BoxGroup("Informasi Bangunan")] 
-        _5_hep = 4, +    [TextArea(1550)] 
-        _6_JKM_D_JKA = 5, +    public string maklumatPertama; 
-        _7_PEJABAT_PENTADBIRAN = 6, +    [BoxGroup("Informasi Bangunan")] 
-        _8_JMSK = 7, +    [TextArea(15, 50)] 
-        _9_DEWAN_WARISAN = 8, +    public string maklumatKedua;
-        _10_STUDENT_CENTRE = 9, +
-        _11_GALERI_PUO = 10, +
-        _12_FUTSAL_CAMPUS_A = 11, +
-        _13_BENGKEL_MEKANIKAL = 12, +
-        _14_BENGKEL_AWAM = 13, +
-        _15_PERPUSTAKAAN = 14, +
-        _16_DEWAN_JUBLI = 15, +
-        _17_JMSK_D_JKM = 16, +
-        _18_BENGKKEL_AKM = 17, +
-        _19_JKP = 18, +
-        _20_CAFE_JKE = 19, +
-        _21_JTMK = 20, +
-        _22_JKE = 21 +
-    }+
  
-    [Title("TEXT INPUT")] +    public float xLocation
-    public TMP_InputField tmp; +    public float zLocation
-    [Title("HOLO MATERIAL")] +}
-    public Material holoMaterial+
-    public GameObject bangunanChild; +
-    [SerializeField] +
-    [EnumToggleButtons] +
-    [Title("SENARAI BANGUNAN")] +
-    private SenaraiBangunan senaraiBangunan;+
  
-    private Bangunan bangunan; 
-    private List<Bangunan> bangunanList; 
-     
- 
-    private void Start() 
-    { 
-        bangunan = new Bangunan(); 
-        bangunanChild = new GameObject(); 
-        bangunanList = GameObject.Find("Building List Control").GetComponent<SearchSystemController>().bangunanList; 
-        bangunan = bangunanList[(int)senaraiBangunan]; 
- 
- 
-        Debug.Log("Bangunan " + bangunan.namaBangunan); 
- 
-        instantiateNewHologram(); 
-        setActiveHide(false); 
-    } 
- 
-    public void openSearch() 
-    { 
-        var button = GameObject.Find("Button_Building_List").GetComponent<OpenCloseUI>(); 
-        button.openObjet(); 
- 
-        tmp.text = bangunan.namaBangunan; 
-        GameObject.Find("Building List Control").GetComponent<SearchSystemController>().DeleteList(); 
-        GameObject.Find("Building List Control").GetComponent<SearchSystemController>().Search(); 
-        GameObject.Find("Camera Rig").GetComponent<CameraController>().gotToVector3(bangunan.xLocation,bangunan.zLocation); 
-    } 
- 
- 
-    private void instantiateNewHologram() 
-    { 
-        var newItem = Instantiate(this, this.transform.position, this.transform.rotation); 
-        bangunanChild = newItem.gameObject; 
-        bangunanChild.transform.localScale += new Vector3(0.01f, 0.01f, 0.01f); 
-        bangunanChild.transform.SetParent(this.transform); 
-        Destroy(bangunanChild.GetComponent<BuildingInteract>()); 
-        bangunanChild.layer = LayerMask.NameToLayer("Default"); 
-        bangunanChild.GetComponent<Renderer>().material = holoMaterial; 
- 
-    } 
- 
-    public void setActiveHide(bool x) 
-    { 
-        bangunanChild.SetActive(x); 
-    } 
-} 
 </code> </code>
  
-<file | openSearch() >  
-This method is used to open button game object and start searching when user click the building 
-</file> 
  
-<file | instantiateNewHologram() >  +===== Button Lerp To Building =====
-Create hologram when mouse pointed - it will duplicate object set as child and increase size to 0.01 +
-</file> +
- +
-<file | setActiveHide(bool x) >  +
-active and deactive hologram object +
-</file> +
- +
-===== Building Interact =====+
  
 <code CSharp | Full Script> <code CSharp | Full Script>
-using Sirenix.OdinInspector; 
 using System.Collections; using System.Collections;
 using System.Collections.Generic; using System.Collections.Generic;
 +using UnityEngine;
 using TMPro; using TMPro;
-using UnityEngine;+using System;
  
-public class BuildingInteract : MonoBehaviour +#region Code Information 
-{ +/* 
-    public enum SenaraiBangunan +    This script is for button lerp to building. 
-    { +    So we will get ScriptableObject Bangunan from SearchSystemController iteration 
-        _1_pusat_islam = 0, +    and use building location values to lerp into the preferred location 
-        _2_anjung_premier = 1, + */ 
-        _3_cisec = 2, +#endregion
-        _4_dewan_jka = 3, +
-        _5_hep = 4, +
-        _6_JKM_D_JKA = 5, +
-        _7_PEJABAT_PENTADBIRAN = 6, +
-        _8_JMSK = 7, +
-        _9_DEWAN_WARISAN = 8, +
-        _10_STUDENT_CENTRE = 9, +
-        _11_GALERI_PUO = 10, +
-        _12_FUTSAL_CAMPUS_A = 11, +
-        _13_BENGKEL_MEKANIKAL = 12, +
-        _14_BENGKEL_AWAM = 13, +
-        _15_PERPUSTAKAAN = 14, +
-        _16_DEWAN_JUBLI = 15, +
-        _17_JMSK_D_JKM = 16, +
-        _18_BENGKKEL_AKM = 17, +
-        _19_JKP = 18, +
-        _20_CAFE_JKE = 19, +
-        _21_JTMK = 20, +
-        _22_JKE = 21 +
-    }+
  
-    [Title("TEXT INPUT")] +public class ButtonLerpToBuilding : MonoBehaviour
-    public TMP_InputField tmp; +
-    [Title("HOLO MATERIAL")] +
-    public Material holoMaterial; +
-    public GameObject bangunanChild; +
-    [SerializeField] +
-    [EnumToggleButtons] +
-    [Title("SENARAI BANGUNAN")] +
-    private SenaraiBangunan senaraiBangunan; +
- +
-    private Bangunan bangunan; +
-    private List<Bangunan> bangunanList; +
-     +
- +
-    private void Start() +
-    { +
-        bangunan = new Bangunan(); +
-        bangunanChild = new GameObject(); +
-        bangunanList = GameObject.Find("Building List Control").GetComponent<SearchSystemController>().bangunanList; +
-        bangunan = bangunanList[(int)senaraiBangunan]; +
- +
- +
-        Debug.Log("Bangunan " + bangunan.namaBangunan); +
- +
-        instantiateNewHologram(); +
-        setActiveHide(false); +
-    } +
- +
-    public void openSearch() +
-    { +
-        var button = GameObject.Find("Button_Building_List").GetComponent<OpenCloseUI>(); +
-        button.openObjet(); +
- +
-        tmp.text = bangunan.namaBangunan; +
-        GameObject.Find("Building List Control").GetComponent<SearchSystemController>().DeleteList(); +
-        GameObject.Find("Building List Control").GetComponent<SearchSystemController>().Search(); +
-        GameObject.Find("Camera Rig").GetComponent<CameraController>().gotToVector3(bangunan.xLocation,bangunan.zLocation); +
-    } +
- +
- +
-    private void instantiateNewHologram() +
-    { +
-        var newItem = Instantiate(this, this.transform.position, this.transform.rotation); +
-        bangunanChild = newItem.gameObject; +
-        bangunanChild.transform.localScale += new Vector3(0.01f, 0.01f, 0.01f); +
-        bangunanChild.transform.SetParent(this.transform); +
-        Destroy(bangunanChild.GetComponent<BuildingInteract>()); +
-        bangunanChild.layer = LayerMask.NameToLayer("Default"); +
-        bangunanChild.GetComponent<Renderer>().material = holoMaterial; +
- +
-    } +
- +
-    public void setActiveHide(bool x) +
-    { +
-        bangunanChild.SetActive(x); +
-    } +
-+
-</code> +
- +
-<file | openSearch() >  +
-This method is used to open button game object and start searching when user click the building +
-</file> +
- +
-<file | instantiateNewHologram() >  +
-Create hologram when mouse pointed - it will duplicate object set as child and increase size to 0.01 +
-</file> +
- +
-<file | setActiveHide(bool x) >  +
-active and deactive hologram object +
-</file> +
- +
-===== Building Interact ===== +
- +
-<code CSharp | Full Script> +
-using Sirenix.OdinInspector; +
-using System.Collections; +
-using System.Collections.Generic; +
-using TMPro; +
-using UnityEngine; +
- +
-public class BuildingInteract : MonoBehaviour+
 { {
-    public enum SenaraiBangunan +    public Bangunan bangunan;
-    { +
-        _1_pusat_islam = 0, +
-        _2_anjung_premier = 1, +
-        _3_cisec = 2, +
-        _4_dewan_jka = 3, +
-        _5_hep = 4, +
-        _6_JKM_D_JKA = 5, +
-        _7_PEJABAT_PENTADBIRAN = 6, +
-        _8_JMSK = 7, +
-        _9_DEWAN_WARISAN = 8, +
-        _10_STUDENT_CENTRE = 9, +
-        _11_GALERI_PUO = 10, +
-        _12_FUTSAL_CAMPUS_A = 11, +
-        _13_BENGKEL_MEKANIKAL = 12, +
-        _14_BENGKEL_AWAM = 13, +
-        _15_PERPUSTAKAAN = 14, +
-        _16_DEWAN_JUBLI = 15, +
-        _17_JMSK_D_JKM = 16, +
-        _18_BENGKKEL_AKM = 17, +
-        _19_JKP = 18, +
-        _20_CAFE_JKE = 19, +
-        _21_JTMK = 20, +
-        _22_JKE = 21 +
-    }+
  
-    [Title("TEXT INPUT")] +    public void LerpToBuilding()
-    public TMP_InputField tmp; +
-    [Title("HOLO MATERIAL")] +
-    public Material holoMaterial; +
-    public GameObject bangunanChild; +
-    [SerializeField] +
-    [EnumToggleButtons] +
-    [Title("SENARAI BANGUNAN")] +
-    private SenaraiBangunan senaraiBangunan; +
- +
-    private Bangunan bangunan; +
-    private List<Bangunan> bangunanList; +
-     +
- +
-    private void Start()+
     {     {
-        bangunan = new Bangunan(); +        FindObjectOfType<CameraController>().gameObject.GetComponent<CameraController>().gotToVector3(bangunan.xLocation, bangunan.zLocation);
-        bangunanChild = new GameObject(); +
-        bangunanList = GameObject.Find("Building List Control").GetComponent<SearchSystemController>().bangunanList; +
-        bangunan = bangunanList[(int)senaraiBangunan]; +
- +
- +
-        Debug.Log("Bangunan " + bangunan.namaBangunan); +
- +
-        instantiateNewHologram(); +
-        setActiveHide(false); +
-    } +
- +
-    public void openSearch() +
-    { +
-        var button = GameObject.Find("Button_Building_List").GetComponent<OpenCloseUI>(); +
-        button.openObjet(); +
- +
-        tmp.text = bangunan.namaBangunan; +
-        GameObject.Find("Building List Control").GetComponent<SearchSystemController>().DeleteList(); +
-        GameObject.Find("Building List Control").GetComponent<SearchSystemController>().Search(); +
-        GameObject.Find("Camera Rig").GetComponent<CameraController>().gotToVector3(bangunan.xLocation,bangunan.zLocation); +
-    } +
- +
- +
-    private void instantiateNewHologram() +
-    { +
-        var newItem = Instantiate(this, this.transform.position, this.transform.rotation); +
-        bangunanChild = newItem.gameObject; +
-        bangunanChild.transform.localScale += new Vector3(0.01f, 0.01f, 0.01f); +
-        bangunanChild.transform.SetParent(this.transform); +
-        Destroy(bangunanChild.GetComponent<BuildingInteract>()); +
-        bangunanChild.layer = LayerMask.NameToLayer("Default"); +
-        bangunanChild.GetComponent<Renderer>().material = holoMaterial; +
- +
-    } +
- +
-    public void setActiveHide(bool x) +
-    { +
-        bangunanChild.SetActive(x);+
     }     }
 } }
-</code> 
  
-<file | openSearch() >  
-This method is used to open button game object and start searching when user click the building 
-</file> 
- 
-<file | instantiateNewHologram() >  
-Create hologram when mouse pointed - it will duplicate object set as child and increase size to 0.01 
-</file> 
- 
-<file | setActiveHide(bool x) >  
-active and deactive hologram object 
-</file> 
- 
-===== Building Interact ===== 
- 
-<code CSharp | Full Script> 
-using Sirenix.OdinInspector; 
-using System.Collections; 
-using System.Collections.Generic; 
-using TMPro; 
-using UnityEngine; 
- 
-public class BuildingInteract : MonoBehaviour 
-{ 
-    public enum SenaraiBangunan 
-    { 
-        _1_pusat_islam = 0, 
-        _2_anjung_premier = 1, 
-        _3_cisec = 2, 
-        _4_dewan_jka = 3, 
-        _5_hep = 4, 
-        _6_JKM_D_JKA = 5, 
-        _7_PEJABAT_PENTADBIRAN = 6, 
-        _8_JMSK = 7, 
-        _9_DEWAN_WARISAN = 8, 
-        _10_STUDENT_CENTRE = 9, 
-        _11_GALERI_PUO = 10, 
-        _12_FUTSAL_CAMPUS_A = 11, 
-        _13_BENGKEL_MEKANIKAL = 12, 
-        _14_BENGKEL_AWAM = 13, 
-        _15_PERPUSTAKAAN = 14, 
-        _16_DEWAN_JUBLI = 15, 
-        _17_JMSK_D_JKM = 16, 
-        _18_BENGKKEL_AKM = 17, 
-        _19_JKP = 18, 
-        _20_CAFE_JKE = 19, 
-        _21_JTMK = 20, 
-        _22_JKE = 21 
-    } 
- 
-    [Title("TEXT INPUT")] 
-    public TMP_InputField tmp; 
-    [Title("HOLO MATERIAL")] 
-    public Material holoMaterial; 
-    public GameObject bangunanChild; 
-    [SerializeField] 
-    [EnumToggleButtons] 
-    [Title("SENARAI BANGUNAN")] 
-    private SenaraiBangunan senaraiBangunan; 
- 
-    private Bangunan bangunan; 
-    private List<Bangunan> bangunanList; 
-     
- 
-    private void Start() 
-    { 
-        bangunan = new Bangunan(); 
-        bangunanChild = new GameObject(); 
-        bangunanList = GameObject.Find("Building List Control").GetComponent<SearchSystemController>().bangunanList; 
-        bangunan = bangunanList[(int)senaraiBangunan]; 
- 
- 
-        Debug.Log("Bangunan " + bangunan.namaBangunan); 
- 
-        instantiateNewHologram(); 
-        setActiveHide(false); 
-    } 
- 
-    public void openSearch() 
-    { 
-        var button = GameObject.Find("Button_Building_List").GetComponent<OpenCloseUI>(); 
-        button.openObjet(); 
- 
-        tmp.text = bangunan.namaBangunan; 
-        GameObject.Find("Building List Control").GetComponent<SearchSystemController>().DeleteList(); 
-        GameObject.Find("Building List Control").GetComponent<SearchSystemController>().Search(); 
-        GameObject.Find("Camera Rig").GetComponent<CameraController>().gotToVector3(bangunan.xLocation,bangunan.zLocation); 
-    } 
- 
- 
-    private void instantiateNewHologram() 
-    { 
-        var newItem = Instantiate(this, this.transform.position, this.transform.rotation); 
-        bangunanChild = newItem.gameObject; 
-        bangunanChild.transform.localScale += new Vector3(0.01f, 0.01f, 0.01f); 
-        bangunanChild.transform.SetParent(this.transform); 
-        Destroy(bangunanChild.GetComponent<BuildingInteract>()); 
-        bangunanChild.layer = LayerMask.NameToLayer("Default"); 
-        bangunanChild.GetComponent<Renderer>().material = holoMaterial; 
- 
-    } 
- 
-    public void setActiveHide(bool x) 
-    { 
-        bangunanChild.SetActive(x); 
-    } 
-} 
 </code> </code>
  
-<file | openSearch() >  +<file | LerpToBuilding() >  
-This method is used to open button game object and start searching when user click the building+When this method called it will lerp to the destination given (axis x and z)
 </file> </file>
- 
-<file | instantiateNewHologram() >  
-Create hologram when mouse pointed - it will duplicate object set as child and increase size to 0.01 
-</file> 
- 
-<file | setActiveHide(bool x) >  
-active and deactive hologram object 
-</file> 
- 
- 
- --- //[[admin@puov2.gementar.com|Hilmi]] 2022/07/25 11:51// 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
  
  

QR Code
QR Code wiki:class_diagram (generated for current page)
Hello World!
DokuWiki with monobook... rules!