/// <summary> /// Instantiate a portal through ASL to ensure it is created for all clients. /// </summary> /// <param name="position">Portal position in world space.</param> /// <param name="forward">Portal front-facing direction in world space.</param> /// <param name="up">Portal up direction in world space.</param> /// <param name="vType">Portal view type, see Portal.ViewType.</param> /// <param name="portalPrefab">Prefab to be used for portal instantiation. /// The prefab should include a component for a Portal, or Portal extension, script.</param> /// <returns>Instantiated portal.</returns> public Portal MakePortal(Vector3 position, Vector3 forward, Vector3 up, Portal.ViewType vType = Portal.ViewType.VIRTUAL, string portalPrefab = "Portal") { GameObject newPortal = objManager.InstantiateOwnedObject(portalPrefab) as GameObject; newPortal.transform.position = position; newPortal.transform.rotation = Quaternion.LookRotation(forward, up); Portal p = newPortal.GetComponent <Portal>(); p.Initialize(vType, player); return(p); }
//PlayerCreatePortal //Try to create a portal where the player camera is looking at on the plane public void PlayerCreatePortal(Vector3 position, Vector3 forward, Vector3 up, Portal.ViewType vType = Portal.ViewType.VIRTUAL) { portalManager.MakePortal(position, forward, up, vType); }