Exemplo n.º 1
0
 protected override void Awake()
 {
     base.Awake();
     interactable = GetComponent <Interactable>();
     centerTransf = transform.Find("Center");
     outlined     = GetComponent <Outlined>();
 }
Exemplo n.º 2
0
 public void Awake()
 {
     if (outlined == null)
     {
         outlined = GetComponent <Outlined>();
     }
     started = startOnAwake;
 }
Exemplo n.º 3
0
        protected override GameObject CreatePreview()
        {
            previewRoot = transform.Find("Preview");
            GameObject modelGO = transform.Find("Model").gameObject;
            GameObject prev    = Instantiate(modelGO, previewRoot);

            prev.name = "PreviewModel";
            prev.transform.localPosition = Vector3.zero;
            Renderer[] renderers = prev.GetComponentsInChildren <Renderer>();
            foreach (Renderer renderer in renderers)
            {
                renderer.renderingLayerMask = 0;
                renderer.shadowCastingMode  = UnityEngine.Rendering.ShadowCastingMode.Off;
            }
            previewOutlined          = previewRoot.GetComponent <Outlined>();
            previewOutlined.listMode = Outlined.Mode.Whitelist;
            previewOutlined.objectList.Add(prev.transform);
            return(previewRoot.gameObject);
        }
Exemplo n.º 4
0
        private void Awake()
        {
            roomnet      = GetComponentInParent <RoomNetwork>();
            link         = GetComponentInParent <RoomLink>();
            entry1       = transform.Find("Entry1");
            entry2       = transform.Find("Entry2");
            centerTransf = transform.Find("Center");
            Vector3 entry1Pos = roomnet.WorldToRelativePos(entry1.position);
            Vector3 entry2Pos = roomnet.WorldToRelativePos(entry2.position);

            if (Vector3.Distance(entry1Pos, roomnet.WorldToRelativePos(link.room1.center)) < Vector3.Distance(entry2Pos, roomnet.WorldToRelativePos(link.room1.center)))
            {
                link.entry1 = entry1Pos;
                link.entry2 = entry2Pos;
            }
            else
            {
                link.entry1   = entry2Pos;
                link.entry2   = entry1Pos;
                link.reversed = true;
            }

            outlined = GetComponent <Outlined>();
        }