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:16] 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 251: Line 250:
 </file> </file>
  
-===== Building Interact =====+===== Camera Controller =====
  
 <code CSharp | Full Script> <code CSharp | Full Script>
-using Sirenix.OdinInspector;+using Micosmo.SensorToolkit; 
 +using System;
 using System.Collections; using System.Collections;
 using System.Collections.Generic; using System.Collections.Generic;
-using TMPro; 
 using UnityEngine; using UnityEngine;
  
-public class BuildingInteract : MonoBehaviour+#region Code Information 
 +/* 
 +    This script is for cammeracontroller 
 +    prettymuch self explainatory 
 +     
 +    OPENCLOSEUI.UIOPENED IS USED TO DETERMINE IF THERE'S ANY UI OPEN 
 + 
 +    gotovector3() <-- called to set location elsewhere. 
 + 
 + */ 
 +#endregion 
 + 
 +public class CameraController : 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 float movementSpeed
-    public TMP_InputField tmp; +    public float movementTime
-    [Title("HOLO MATERIAL")] +    public float rotationSpeed
-    public Material holoMaterial+    public Vector3 scrollSpeed;
-    public GameObject bangunanChild+
-    [SerializeField] +
-    [EnumToggleButtons] +
-    [Title("SENARAI BANGUNAN")] +
-    private SenaraiBangunan senaraiBangunan; +
- +
-    private Bangunan bangunan; +
-    private List<Bangunan> bangunanList;+
          
 +    public Transform AttachedCamera;
  
-    private void Start() +    public Vector3 newPosition; 
-    +    public Vector3 newCameraPosition;
-        bangunan = new Bangunan(); +
-        bangunanChild = new GameObject(); +
-        bangunanList = GameObject.Find("Building List Control").GetComponent<SearchSystemController>().bangunanList; +
-        bangunan = bangunanList[(int)senaraiBangunan];+
  
 +    public Quaternion newRotation;
  
-        Debug.Log("Bangunan " + bangunan.namaBangunan);+    private RaySensor sensor;
  
-        instantiateNewHologram(); +    // Start is called before the first frame update 
-        setActiveHide(false); +    void Start()
-    } +
- +
-    public void openSearch()+
     {     {
-        var button GameObject.Find("Button_Building_List").GetComponent<OpenCloseUI>(); +         
-        button.openObjet();+        sensor GetComponentInChildren<RaySensor>(); 
 +        buildingSelected = new GameObject();
  
-        tmp.text bangunan.namaBangunan+        newPosition transform.position
-        GameObject.Find("Building List Control").GetComponent<SearchSystemController>().DeleteList()+        newRotation = transform.rotation
-        GameObject.Find("Building List Control").GetComponent<SearchSystemController>().Search(); +        newCameraPosition = AttachedCamera.localPosition;
-        GameObject.Find("Camera Rig").GetComponent<CameraController>().gotToVector3(bangunan.xLocation,bangunan.zLocation);+
     }     }
  
- +    private void FixedUpdate()
-    private void instantiateNewHologram()+
     {     {
-        var newItem = Instantiate(this, this.transform.position, this.transform.rotation); +        HandleMouseMovementInput(); 
-        bangunanChild = newItem.gameObject; +        HandleMovementInput();
-        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)+    public void gotToVector3(float x, float z)
     {     {
-        bangunanChild.SetActive(x);+        newPosition = new Vector3(x, this.transform.position.y, z);
     }     }
-} 
-</code> 
  
-<file | openSearch()  +    void HandleMovementInput() 
-This method is used to open button game object and start searching when user click the building +    { 
-</file>+        if (OpenCloseUI.UIopened != true)//DETERMINE IF THERE'S ANY UI OPEN 
 +        { 
 +            if (Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.UpArrow)) 
 +            { 
 +                newPosition += (transform.forward * movementSpeed); 
 +            }
  
-<file instantiateNewHologram()  +            if (Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.DownArrow)
-Create hologram when mouse pointed - it will duplicate object set as child and increase size to 0.01 +            { 
-</file>+                newPosition += (transform.forward * -movementSpeed); 
 +            }
  
-<file setActiveHide(bool x +            if (Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.LeftArrow)
-active and deactive hologram object +            { 
-</file>+                newPosition += (transform.right * -movementSpeed); 
 +            }
  
-===== Building Interact =====+            if (Input.GetKey(KeyCode.D) || Input.GetKey(KeyCode.RightArrow)) 
 +            { 
 +                newPosition +(transform.right * movementSpeed); 
 +            }
  
-<code CSharp | Full Script> +            if (Input.GetKey(KeyCode.Q)) 
-using Sirenix.OdinInspector; +            { 
-using System.Collections; +                newRotation *= Quaternion.Euler(Vector3.up * -rotationSpeed)
-using System.Collections.Generic+            }
-using TMPro; +
-using UnityEngine;+
  
-public class BuildingInteract : MonoBehaviour +            if (Input.GetKey(KeyCode.E)) 
-+            
-    public enum SenaraiBangunan +                newRotation *Quaternion.Euler(Vector3.up * rotationSpeed); 
-    { +            }
-        _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")+            if (Input.GetAxis("Mouse ScrollWheel"> 0f || Input.GetKey(KeyCode.Z)// forward 
-    public TMP_InputField tmp; +            { 
-    [Title("HOLO MATERIAL")] +                if (newCameraPosition.y > 20newCameraPosition += scrollSpeed; 
-    public Material holoMaterial; +            }
-    public GameObject bangunanChild; +
-    [SerializeField] +
-    [EnumToggleButtons] +
-    [Title("SENARAI BANGUNAN")] +
-    private SenaraiBangunan senaraiBangunan;+
  
-    private Bangunan bangunan; +            if (Input.GetAxis("Mouse ScrollWheel") < 0f || Input.GetKey(KeyCode.X)) // backwards 
-    private List<Bangunan> bangunanList+            { 
-    +                if (newCameraPosition.y 60) newCameraPosition -= scrollSpeed
 +            } 
 +        }
  
-    private void Start() +        AttachedCamera.localPosition Vector3.Lerp(AttachedCamera.localPosition, newCameraPosition, Time.fixedDeltaTime * movementTime); 
-    { +        transform.rotation Quaternion.Lerp(transform.rotation, newRotation, Time.fixedDeltaTime * movementTime); 
-        bangunan new Bangunan(); +        transform.position Vector3.Lerp(transform.position, newPosition, Time.fixedDeltaTime * movementTime);
-        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()+    void HandleMouseMovementInput()
     {     {
-        var button GameObject.Find("Button_Building_List").GetComponent<OpenCloseUI>(); +        var ray GetComponentInChildren<Camera>().ScreenPointToRay(Input.mousePosition).direction
-        button.openObjet();+        sensor.Direction = ray; 
 + 
 +        if (OpenCloseUI.UIopened != true)//DETERMINE IF THERE'S ANY UI OPEN 
 +        {
  
-        tmp.text = bangunan.namaBangunan; +            if (Input.GetKey(KeyCode.Mouse0)
-        GameObject.Find("Building List Control").GetComponent<SearchSystemController>().DeleteList(); +            { 
-        GameObject.Find("Building List Control").GetComponent<SearchSystemController>().Search(); +                if (detected == true) 
-        GameObject.Find("Camera Rig").GetComponent<CameraController>().gotToVector3(bangunan.xLocation,bangunan.zLocation);+                { 
 +                    buildingSelected.GetComponent<BuildingInteract>().openSearch(); 
 +                } 
 +            } 
 +        }
     }     }
  
- +    bool detected; 
-    private void instantiateNewHologram()+    public GameObject buildingSelected; 
 +    public void DetectBuilding()
     {     {
-        var newItem Instantiate(this, this.transform.position, this.transform.rotation); +        var detectedItem sensor.GetDetectionsByDistance();
-        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;+
  
 +            buildingSelected = detectedItem[0];
 +            buildingSelected.GetComponent<BuildingInteract>().setActiveHide(true);
 +            detected = true;
     }     }
  
-    public void setActiveHide(bool x)+    public void DetectLostBuilding()
     {     {
-        bangunanChild.SetActive(x);+        buildingSelected.GetComponent<BuildingInteract>().setActiveHide(false); 
 +        detected = false;
     }     }
 } }
 +
 </code> </code>
  
-<file | openSearch() >  +<file | goToVector3(float x, float z);>  
-This method is used to open button game object and start searching when user click the building+This method for outside of class to manipulate camera rig position
 </file> </file>
  
-<file | instantiateNewHologram() >  +<file | HandleMovementInput();>  
-Create hologram when mouse pointed - it will duplicate object set as child and increase size to 0.01+This method will be call by fixed update to handle WASD camera movement.
 </file> </file>
  
-<file | setActiveHide(bool x) >  +<file | HandleMouseMovementInput()>  
-active and deactive hologram object+This method is to handle mouse movement input by using raycast. This is how we detect building to select it.
 </file> </file>
  
-===== Building Interact ===== +<file | DetectBuilding()>  
- +This method will be called by Ray EVENT gameobject, it will fireup this method when it detect building.
-<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> +
- +
-<file | openSearch() >  +
-This method is used to open button game object and start searching when user click the building+
 </file> </file>
  
-<file | instantiateNewHologram() >  +<file | DetectLostBuilding()>  
-Create hologram when mouse pointed - it will duplicate object set as child and increase size to 0.01+This method will be called by Ray EVENT gameobject, it will fireup this method when it lost detect the selected building
 </file> </file>
  
-<file | setActiveHide(bool x) >  
-active and deactive hologram object 
-</file> 
  
-===== 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 
 +/* 
 +    This script is for button lerp to building. 
 +    So we will get ScriptableObject Bangunan from SearchSystemController iteration 
 +    and use building location values to lerp into the preferred location 
 + */ 
 +#endregion 
 + 
 +public class ButtonLerpToBuilding : 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> </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!