private void Awake() { if (!instance) { instance = this; } }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody2D> (); gunPivot = transform.GetChild(0); portalManager = GameObject.FindGameObjectWithTag("PortalManager").GetComponent <PortalManager>(); gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>(); }
public void Cmd_WarpLocal(string anchorName) { if (PortalManager.CheckPortalAnchor(anchorName)) { WarpLocal(anchorName); } }
//check for mouse input void Update() { RaycastHit hit; //on left mouse button down if (Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); //the mouse ray has hit a collider in the scene if (Physics.Raycast(ray, out hit)) { //reposition pointer object to the hit point pointerObj.transform.position = hit.point; //construct path: //starting at the current gameobject position //ending at the position of the pointer object path = PortalManager.GetPath(transform.position, pointerObj.transform.position); //stop existing movement routines StopAllCoroutines(); //start new agent movement to the destination StartCoroutine(GoToDestination()); } } }
private void init(bool fullRegen = false) { Vector3 min = new Vector3(0, Constants.HUD_OFFSET, 0f); Vector3 max = new Vector3(Constants.RESOLUTION_X, Constants.RESOLUTION_Y, 0f); this.boundary = new BoundingBox(min, max); this.rand = new Random(); PositionGenerator.getInstance().init(this.rand); SpawnGenerator.getInstance().SpawnRequests.Clear(); if (StateManager.getInstance().GameMode == GameMode.OnePlayer) { this.playerOne = new Snake(this.content, Constants.HEADING_UP, 0f, ConfigurationManager.getInstance().PlayerOnesControls); } else { this.playerOne = new Snake(this.content, Constants.HEADING_UP, 100f, ConfigurationManager.getInstance().PlayerOnesControls); this.playerTwo = new Snake(this.content, Constants.HEADING_UP, -100f, ConfigurationManager.getInstance().PlayerTwosControls); } if (fullRegen) { this.backGround = new BackGround(this.content); this.hud = new HUD(this.content); this.foodManager = new FoodManager(content, this.rand); this.portals = new PortalManager(content, this.rand); this.walls = new WallManager(content, this.rand); } #if DEBUG this.debugLine = LoadingUtils.load <Texture2D>(this.content, "Chip"); #endif }
void OnTriggerEnter(Collider collider) { if (collider.tag == "Portal" && TPCooldown <= 0) { TPCooldown = 0.05f; SelfPortal portal = collider.GetComponentInParent <SelfPortal>(); if (portal != null) { PortalManager portalManager = portal.getPortalManager(); if (portalManager != null) { //save origine porsition rotation velocity Vector3 originPos = transform.position; Quaternion originRot = transform.rotation; Vector3 origineVelocity = body.velocity; //change rotation transform.rotation = portalManager.GetOffsetRotation(originRot, originPos); //change position transform.position = portalManager.GetOffsetPosition(originPos); //change velocity body.velocity = portalManager.GetOffsetRotation(Quaternion.Euler(origineVelocity), originPos) * origineVelocity; //GetComponentInChildren<PlayerCamera>().setCameraRotation(); //cam.MoveRotation(Quaternion.Euler(new Vector3(portalManager.GetOffsetRotation(originRot, originPos).x, portalManager.GetOffsetRotation(originRot, originPos).y, portalManager.GetOffsetRotation(originRot, originPos).z))); portalManager.Traveling(); } } } }
private void OnTriggerEnter(Collider other) { //get the player reference from the collider Player player = other.GetComponent <Player>(); //if the player isn't null then add them to the room, set the player's room to be this room, and activate any AI in the room that aren't activated if (player != null) { Debug.Log("player " + player.name + " entered room " + name + "."); m_PlayersInRoom.Add(player); //swap the cameras of the newly activated room PortalManager.SwapToNewCamera(player.MyIslandRoom, this); //swap any additional room's LOD version with the appropriate version //RoomManager.Instance.SwapLODs(this); player.MyIslandRoom = this; foreach (AI ai in m_EnemiesInRoom) { if (ai != null) { if (!ai.enabled) { ai.SetActive(true); ai.enabled = true; ai.ActivateEnemy(); } } } } }
void Start() { player = GameObject.Find("Player"); portal = GameObject.Find("Portal"); portalMgr = GameObject.Find("GameManager").GetComponent <PortalManager>(); onPortal = false; }
protected void Awake() { _uiCamera = UICamera.Instance; _portalManager = PortalManager.Instance; _animator = GetComponent <Animator>(); _titleVisible = true; }
// Start is called before the first frame update void Start() { collisionObjectManager = FindObjectOfType(typeof(CollisionObjectManager)) as CollisionObjectManager; portalManager = FindObjectOfType(typeof(PortalManager)) as PortalManager; portalManager = portalManager.GetComponent <PortalManager>(); leapGestures = GetComponent <LeapGestures>(); }
static void Main() { PortalManager.Initialize(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }
/// <summary> /// Receive a portal usage from the client, check the portal in the PortalManager /// Raise a warning if the portal isn't found. /// <seealso cref="PortalManager.GetPortal"/> /// </summary> public void OnSendUsePortal(SagaMap.Packets.Client.SendUsePortal p) { if (this.state != SESSION_STATE.MAP_LOADED) { return; } PortalManager.PortalInfo portal; portal = PortalManager.GetPortal(p.GetPortalID(), this.Char.mapID); if (portal.m_mapID != -1) { if (this.Char.mapID == portal.m_mapID)//if the destination is current map,there is no need to change the map. { this.map.TeleportActor(this.Char, portal.m_x, portal.m_y, portal.m_z); } else { this.map.SendActorToMap(this.Char, Convert.ToByte(portal.m_mapID), portal.m_x, portal.m_y, portal.m_z); } } else { if (this.Char.GMLevel >= 2) { this.SendMessage("Saga", "Cannot find Portal with toID:" + p.GetPortalID() + " and fromID:" + this.Char.mapID + " in database", SagaMap.Packets.Server.SendChat.MESSAGE_TYPE.SYSTEM_MESSAGE); } else { this.SendMessage("Saga", "This Portal is not implemented yet!", SagaMap.Packets.Server.SendChat.MESSAGE_TYPE.SYSTEM_MESSAGE); } Logger.ShowWarning("Cannot find Portal with toID:" + p.GetPortalID() + " and fromID:" + this.Char.mapID + " in database"); } }
internal static void OnC2SAskMapMove(ByteBuffer buffer, Connection connection) { var incPacket = new ZonePackets.C2SAskMoveMap(buffer); var x = ByteUtils.SlicedBytes(buffer.Data, 4, 12); var sb = new StringBuilder(); foreach (var y in x) { sb.Append(y + "|"); } var z = sb.ToString(); var cpos = ClientManager.GetClient(connection).GetSelectedCharacter().CharacterPosition; var portal = PortalManager.getPortal(incPacket.key1, incPacket.key2); var newPos = MapManager.GetMap(portal.fieldTo).wayPointPosition; cpos.Region = portal.fieldTo; cpos.LocationX = newPos.x; cpos.LocationY = newPos.y; cpos.LocationZ = newPos.z; var outPacket = new ZonePackets.S2CAnsMoveMap(portal.id); outPacket.Send(connection); }
// Use this for initialization void Start() { Instance = this; PortalSpawn(); StartCoroutine("EnemyAlive"); }
void Start() { PortalManager = this.GetComponent <PortalManager>(); BulletManager = this.GetComponent <BulletManager>(); SetPlayerData(); SpawnPlayers(); ActivateManagers(); }
void Start() { if (playerCamera == null) { Debug.LogError(transform.name + " => PortalGun: Missing playerCamera"); } _portal_manager = PortalManager.Instance; }
protected async override void OnClick() { //TODO - Get the URL of the Active Portal //HINT: Use PortalManager string portalUrl = PortalManager.GetActivePortal().ToString(); UriBuilder searchURL = new UriBuilder(portalUrl); searchURL.Path = "sharing/rest/search"; string layers = "(type:\"Map Service\" OR type:\"Image Service\" OR type:\"Feature Service\" OR type:\"WMS\" OR type:\"KML\")"; //any public layer content searchURL.Query = string.Format("q={0}&f=json", layers); EsriHttpClient httpClient = new EsriHttpClient(); var searchResponse = httpClient.Get(searchURL.Uri.ToString()); dynamic resultItems = JObject.Parse(await searchResponse.Content.ReadAsStringAsync()); //Use EsriHttpClient to call Online - Use the GET method //TODO get the JSON result from the searchResponse //HINT - examine methoods of searchResponse.Content //TODO Parse the returned JSON - here you will use the Newtonsoft library's JObject //examine JObject.Parse. Use a dynamic type to get the results of the Parse long numberOfTotalItems = resultItems.total.Value; if (numberOfTotalItems == 0) { return; } List <dynamic> resultItemList = new List <dynamic>(); resultItemList.AddRange(resultItems.results); //TODO add the ".results" of the returned JSON. //eg: resultItemList.AddRange(resultItems.results); //get the first result from resultItemList (or an index of your choice) //dynamic item = .... dynamic item = resultItemList[0]; //TODO create an Item via the ItemFactory. Use the ItemFactory.ItemType.PortalItem item type. string itemID = item.id; Item currentItem = ItemFactory.Create(itemID, ItemFactory.ItemType.PortalItem); await QueuedTask.Run(() => { // if we have an item that can be turned into a layer // add it to the map //TODO use the LayerFactory.CreateLayer and the MapView.Active.Map if (LayerFactory.CanCreateLayerFrom(currentItem)) { LayerFactory.CreateLayer(currentItem, MapView.Active.Map); } }); }
public virtual void Awake() { network = GameObject.Find("NetworkManager").GetComponent <UWBNetworkingPackage.NetworkManager>(); portalManager = GameObject.Find("PortalManager").GetComponent <PortalManager>(); worldManager = GameObject.Find("WorldManager").GetComponent <WorldManager>(); Debug.Assert(defaultPortalXform != null); Debug.Assert(portalManager != null); Debug.Assert(worldManager != null); }
public override void Awake() { base.Awake(); portalManager = GameObject.Find("PortalManager").GetComponent <PortalManager>(); Debug.Assert(defaultPortalXform != null); Debug.Assert(portalManager != null); Debug.Assert(selector != null); }
public void WarpLocal(string anchorName) { if (PortalManager.CheckPortalAnchor(anchorName)) { base.Warp(PortalManager.GetPortalAnchorPosition(anchorName)); } UpdateCooldown(20); }
/// <summary> /// Execute the query command /// </summary> private void CmdDoQuery() { try { var httpEsri = new EsriHttpClient() { BaseAddress = PortalManager.GetActivePortal() }; // value has the following format: url with {};Redlands,...,...;Search Query,...,... // where Redlands ... are values and search query are keys var parts = AgolQuery.Value.Split(";".ToCharArray()); var getUrl = parts[0]; // get parameters if (CallParams.Count > 0) { var lstParams = new List <object>() as IList <object>; foreach (var kv in CallParams) { lstParams.Add(kv.Param); } getUrl = string.Format(parts[0], lstParams.ToArray()); } System.Diagnostics.Debug.WriteLine(getUrl); var httpResponse = httpEsri.Get(getUrl); if (httpResponse.StatusCode == HttpStatusCode.OK && httpResponse.Content != null) { var content = httpResponse.Content.ReadAsStringAsync().Result; QueryResult = string.Format(@"{0}{1}", getUrl, System.Environment.NewLine); QueryResult += string.Format(@"IsSuccessStatusCode: {0}{1}", httpResponse.IsSuccessStatusCode, System.Environment.NewLine); QueryResult += string.Format(@"StatusCode: {0}{1}", httpResponse.StatusCode, System.Environment.NewLine); QueryResult += content; if (AgolQuery.Key == ArcGISOnlineQueries.AGSQueryType.GetSelf) { _AgolUser = AgolUser.LoadAgolUser(content); } else if (AgolQuery.Key == ArcGISOnlineQueries.AGSQueryType.GetSearch) { _AgolSearchResult = AgolSearchResult.LoadAgolSearchResult(content); } else if (AgolQuery.Key == ArcGISOnlineQueries.AGSQueryType.GetUserContent) { _AgolUserContent = AgolUserContent.LoadAgolUserContent(content); _AgolFolderContent = null; } else if (AgolQuery.Key == ArcGISOnlineQueries.AGSQueryType.GetUserContentForFolder) { _AgolFolderContent = AgolFolderContent.LoadAgolFolderContent(content); } System.Diagnostics.Debug.WriteLine(QueryResult); } } catch (Exception ex) { QueryResult = ex.ToString(); } }
public void teleport() { // Find portal GameObject portalObject = GameObject.Find(PortalName); PortalManager portalScript = portalObject.GetComponent <PortalManager>(); // Find player GameObject other = GameObject.FindGameObjectWithTag("Player"); other.transform.position = portalObject.transform.position + portalScript.Position; }
//private OnboardingManager onboardingManager; //private WaitForOnboardingComplete buttonDisplayment; //private CameraImageManipulation doorDetection; void Start() { session = FindObjectOfType <ARSession>(); planeManager = FindObjectOfType <ARPlaneManager>(); portalManager = FindObjectOfType <PortalManager>(); textManager = GetComponent <TextManager>(); //onboardingManager = FindObjectOfType<OnboardingManager>(); //buttonDisplayment = FindObjectOfType<WaitForOnboardingComplete>(); //doorDetection = FindObjectOfType<CameraImageManipulation>(); }
public void Open(bool cheat = false) { PortalManager.CloseAllDoors(); isOpening = true; if (cheat) { symmetricDoor = GameObject.FindGameObjectWithTag("RoomStack").GetComponent <RoomTower>().GetStartRoomDoor(); } symmetricDoor.SymmetricalOpen(); PortalManager.CreatePortal(portal, symmetricDoor.portal); }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } }
/// <summary> /// Initializes a new instance of the <see cref="EngineController" /> class. /// </summary> /// <param name="securityManager">The security manager that the <see cref="EngineController" /> operates against.</param> /// <param name="projectManager">The project manager that the <see cref="EngineController" /> operates against.</param> /// <param name="portalManager">The portal manager that the <see cref="EngineController" /> operates against.</param> /// <param name="portalCompiler">The portal compiler that the <see cref="EngineController" /> operates against.</param> /// <param name="logManager">The log manager that the <see cref="EngineController" /> operates against.</param> public EngineController( SecurityManager securityManager, ProjectManager projectManager, PortalManager portalManager, PortalCompiler portalCompiler, LogManager logManager) { _securityManager = securityManager; _projectManager = projectManager; _portalManager = portalManager; _portalCompiler = portalCompiler; _logManager = logManager; }
private void CreatePortal(IEntityDataStruct entityDataStruct) { var sMsgPropCreateEntity_SC_Channel = (SMsgPropCreateEntity_SC_Channel)entityDataStruct; string portalName = "chuansongdian"; var portalPrefab = this.FindByName(portalName); var pos = Vector3.zero; TraceUtil.Log("传送门的生成UID" + sMsgPropCreateEntity_SC_Channel.SMsg_Header.uidEntity + " -- responseOn:" + GameManager.Instance.ResponseHandlerOn.ToString()); sMsgPropCreateEntity_SC_Channel.ChannelValue.MAST_FIELD_VISIBLE_TYPE = EctypeConfigManager.Instance.PortalConfigList[sMsgPropCreateEntity_SC_Channel.BaseValue.OBJECT_FIELD_ENTRY_ID]._portalType; pos = pos.GetFromServer(sMsgPropCreateEntity_SC_Channel.ChannelX, sMsgPropCreateEntity_SC_Channel.ChannelY); var portal = (GameObject)GameObject.Instantiate(portalPrefab, pos, Quaternion.identity); var portalBehaviour = portal.GetComponent <PortalBehaviour>(); //加入箭头挂载脚本 if (ArrowManager.Instance == null) { TraceUtil.Log(SystemModel.Common, TraceLevel.Error, "[ArrowManager.Instance == null]"); } else { ArrowManager.Instance.AddChunnelArrow(portal); } portalBehaviour.PortalDataModel = sMsgPropCreateEntity_SC_Channel; bool Active = sMsgPropCreateEntity_SC_Channel.ChannelValue.MAST_FIELD_VISIBLE_STATE == 0 ? true : false; if (portal.activeSelf != Active) { portal.SetActive(Active); } EntityModel portalDataModel = new EntityModel(); portalDataModel.GO = portal; portalDataModel.Behaviour = portalBehaviour; portalDataModel.EntityDataStruct = sMsgPropCreateEntity_SC_Channel; PortalManager.GetInstance(); EntityController.Instance.RegisteEntity(entityDataStruct.SMsg_Header.uidEntity, portalDataModel); //if (!AddPortalObjToList(portalDataModel)) { TraceUtil.Log(SystemModel.Common,TraceLevel.Error,"传送门列表已满:PortalFactory.PortalFactoryObjcetList"); } }
void Awake( ) { if (!_instance) { _instance = this; } else { Destroy(gameObject); } foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Portal")) { _portalList.Add(obj.GetComponent <Portal>()); } }
/// <summary> /// Gets a page using the given ID that can be both a integer or a string value. /// </summary> private Task <PageItem> GetPageAsync(PortalManager manager, string id, CancellationToken cancellationToken) { int pageId; if (int.TryParse(id, out pageId)) { //return services.Portal.FindPageAsync(pageId, cancellationToken); } var uriParts = id.Split(new[] { '/' }, 2, StringSplitOptions.RemoveEmptyEntries); if (uriParts.Length == 0) { return(Task.FromResult <PageItem>(null)); } //return services.Portal.FindPageAsync(uriParts[0], uriParts.Length > 1 ? uriParts[1] : default(string), cancellationToken); return(Task.FromResult <PageItem>(null)); }
/// <summary> /// Creates a room for the given page. /// </summary> /// <param name="manager">The portal manager.</param> /// <param name="portal">The site.</param> /// <param name="page">The page.</param> /// <param name="cancellationToken">A token to observe while waiting for the task to complete.</param> /// <returns> /// The created chat room. /// </returns> private async Task <ChatRoomInfo> CreateAsync(PortalManager manager, PortalItem portal, PageItem page, CancellationToken cancellationToken) { var chatRoom = new ChatRoomInfo { Id = portal.Id.ToString(), PageId = page.Id, PortalId = portal.Id, ProjectId = portal.Project?.Id }; foreach (var account in portal.Owners) { chatRoom.Users.Add(account.Email.Address, account); } await Store.CreateAsync(chatRoom, cancellationToken); return(chatRoom); }
void Awake() { instance = this; portalsElement = new List<GameObject>(); }
// Use this for initialization void Start() { _instance = this; colliderList = new Dictionary<string, GameObject>(); }
// Use this for initialization void Start() { pm = GameObject.FindGameObjectWithTag ("Portals").GetComponent<PortalManager>(); }