/// <summary> /// Changes the reality for the specified object that comes at a cost /// </summary> /// <param name="objectToChangeRealities">The object to switch to the other reality.</param> /// <param name="cost">The cost associated with this reality shift.</param> public void ChangeReality(GameObject objectToChangeRealities, float cost) { if (ableToShift) { // Switch to the opposite reality we are currently in switch (currentReality) { case Realities.steamPunk: currentReality = Realities.darkair; break; case Realities.darkair: currentReality = Realities.steamPunk; break; default: currentReality = Realities.darkair; break; } // TODO Add animations, sound change, etc. // Change the camera and change the object position to be on the foreground. Deplete manabar. CameraManager.SwitchCamera(); float z; switch (RealityShift.currentReality) { case RealityShift.Realities.steamPunk: z = -3; break; case RealityShift.Realities.darkair: z = 17; break; default: z = -3; break; } var pos = objectToChangeRealities.transform.position; objectToChangeRealities.transform.position = new Vector3(pos.x, pos.y, z); ManaBar.Deplete(cost); } }
/// <summary> /// Changes the reality. /// Use: Used on the OnClick function of buttons. 0 = SteamPunk, 1 = Victorian for input parameters. /// This is just for testing purposes, we will integrate better when the time comes. /// </summary> /// <param name="reality">Reality.</param> public void ChangeReality(int reality) { switch (reality) { case 0: currentReality = Realities.steamPunk; CurrRealityText.text = "SteamPunk : 0"; break; case 1: currentReality = Realities.victorian; CurrRealityText.text = "Victorian : 1"; break; default: currentReality = Realities.steamPunk; CurrRealityText.text = "SteamPunk : 0"; break; } // TODO Add animations, sound change, etc. }