// ----------------------------------------------------------------------------------- // UCE_SetBindpoint // @Server // ----------------------------------------------------------------------------------- public void UCE_SetBindpointFromArea(string name, float x, float y, float z) { if (isAlive) { UCE_myBindpoint = new UCE_BindPoint(); UCE_myBindpoint.name = name; UCE_myBindpoint.position = new Vector3(x, y, z); UCE_myBindpoint.SceneName = SceneManager.GetActiveScene().name; } }
public void UCE_OnPortal(UCE_BindPoint bindpoint) { this.transform.position = bindpoint.position; Database.singleton.CharacterSave(this, false); Database.singleton.SaveCharacterScene(this.name, bindpoint.SceneName); // ask client to switch server this.connectionToClient.Send( new SwitchServerMsg { scenePath = bindpoint.SceneName, characterName = this.name } ); // immediately destroy so nothing messes with the new // position and so it's not saved again etc. NetworkServer.Destroy(this.gameObject); }