public async Task PerformCustomOperation(CustomOperations operation) { if (Result == "" || Result == " ") { return; } double operandmath = double.Parse(Result); switch (operation) { case CustomOperations.Sqrt: Result = Math.Sqrt(operandmath).ToString(); break; case CustomOperations.Sin: Result = Math.Sin(operandmath).ToString(); break; case CustomOperations.Cos: Result = Math.Cos(operandmath).ToString(); break; case CustomOperations.Tan: Result = Math.Tan(operandmath).ToString(); break; case CustomOperations.Log: Result = Math.Log(operandmath).ToString(); break; } await LocalStorageService.SetItemAsync("Result", Result); }
public override void OnInitialize() { base.OnInitialize(); connectAction = new SocketConnectionToolConnectAction(this); connectAction.MouseActionDeactivated += (sender, e) => this.OnMouseActionDeactivated(); operationsOverride = new CustomOperations(this, this); }
void Awake() { // Check if instance already exists, if not set instance to 'this', if instance is not 'this' destory 'this' if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } customOps = FindObjectOfType <NetworkManager>().GetComponent <CustomOperations>(); spawnPoints = FindObjectsOfType <PlayerSpawnPoint>(); txtBawesomeness.text = "Bawesomeness:"; if (playerPrefab == null) { Debug.LogError("<Color=Red>Missing</Color> playerPrefab Reference. Please set it up in GameObject 'Game Manager'"); } else if (PlayerController.localPlayer == null) { Debug.Log("<Color=Green>Player Instantiate</Color> We are Instantiating LocalPlayer from " + SceneManager.GetActiveScene().name); // Default spawn point Vector3 spawnPoint = new Vector3(0, 30, 0); // If array of spawn points exists, choose a random one if (spawnPoints != null && spawnPoints.Length > 0) { spawnPoint = spawnPoints[Random.Range(0, spawnPoints.Length)].transform.position; } Debug.Log("<Color=Green>Spawn Point chosen: </Color>" + spawnPoint); PhotonNetwork.Instantiate(playerPrefab.name, spawnPoint, Quaternion.identity, 0); } Debug.Log("<Color=Green>Awake() for TTGameManager</Color>"); }