private void OnEnable() { if (!_skin) { _skin = E_Helpers.LoadSkin(E_Core.e_guiSkinPathZRace); } _titleColor = new Color32(1, 9, 28, 255); //dark blue regEmail = serializedObject.FindProperty("regEmail"); regUsername = serializedObject.FindProperty("regUsername"); regPassword = serializedObject.FindProperty("regPassword"); contactEmail = serializedObject.FindProperty("contactEmail"); panelLogIn = serializedObject.FindProperty("panelLogIn"); panelRegister = serializedObject.FindProperty("panelRegister"); logUsername = serializedObject.FindProperty("logUsername"); logPassword = serializedObject.FindProperty("logPassword"); isOnline = serializedObject.FindProperty("isOnline"); playFabID = serializedObject.FindProperty("playFabID"); displayName = serializedObject.FindProperty("displayName"); loadScene = serializedObject.FindProperty("loadScene"); panelRecover = serializedObject.FindProperty("panelRecover"); requestEmail = serializedObject.FindProperty("requestEmail"); textEmailSend = serializedObject.FindProperty("textEmailSend"); errorText = serializedObject.FindProperty("errorText"); }
// Antes de poner la GUI en el inspector, asignaremos las variables su propiedad // los nombres tienen que concidir para que funcionen. private void OnEnable() { if (!_skin) { _skin = E_Helpers.LoadSkin(E_Core.e_guiSkinPathZRace); } _titleColor = new Color32(1, 9, 28, 255); //dark blue nickName = serializedObject.FindProperty("nickName"); textPlayers = serializedObject.FindProperty("textPlayers"); connections = serializedObject.FindProperty("connections"); parentText = serializedObject.FindProperty("parentText"); countDown = serializedObject.FindProperty("countDown"); countdownInstance = serializedObject.FindProperty("countdownInstance"); buttonInteract = serializedObject.FindProperty("buttonInteract"); isLoading = serializedObject.FindProperty("isLoading"); canRotate = serializedObject.FindProperty("canRotate"); rotSpeed = serializedObject.FindProperty("rotSpeed"); MaxPlayers = serializedObject.FindProperty("MaxPlayers"); minPlayersPerRoom = serializedObject.FindProperty("minPlayersPerRoom"); playersCount = serializedObject.FindProperty("playersCount"); NameScene = serializedObject.FindProperty("NameScene"); gameObjectListPlayers = serializedObject.FindProperty("gameObjectListPlayers"); Version = serializedObject.FindProperty("Version"); AutoConnect = serializedObject.FindProperty("AutoConnect"); }
protected override void OnEnable() { #region Properties autoTravel = serializedObject.FindProperty("autoTravel"); buttonToTravel = serializedObject.FindProperty("buttonToTravel"); activeOnEnter = serializedObject.FindProperty("activeOnEnter"); LoadSceneName = serializedObject.FindProperty("LoadSceneName"); SpawnAtPoint = serializedObject.FindProperty("SpawnAtPoint"); inspectorDatabase = serializedObject.FindProperty("database"); sendAllTogether = serializedObject.FindProperty("sendAllTogether"); OnOwnerEnterTrigger = serializedObject.FindProperty("OnOwnerEnterTrigger"); OnOwnerExitTrigger = serializedObject.FindProperty("OnOwnerExitTrigger"); OnAnyPlayerEnterTrigger = serializedObject.FindProperty("OnAnyPlayerEnterTrigger"); OnAnyPlayerExitTrigger = serializedObject.FindProperty("OnAnyPlayerExitTrigger"); BeforeTravel = serializedObject.FindProperty("BeforeTravel"); #endregion sceneNames.Clear(); database = (SceneDatabase)inspectorDatabase.objectReferenceValue; if (!database) { selectedDatabaseIndex = -1; } else { for (int i = 0; i < database.storedScenesData.Count; i++) { if (database.storedScenesData[i].sceneName == LoadSceneName.stringValue) { selectedDatabaseIndex = i; previous_selectedDatabaseIndex = i; } sceneNames.Add(database.storedScenesData[i].sceneName); } if (selectedDatabaseIndex != -1) { for (int i = 0; i < database.storedScenesData[selectedDatabaseIndex].entrancePoints.Count; i++) { if (database.storedScenesData[selectedDatabaseIndex].entrancePoints[i] == SpawnAtPoint.stringValue) { selectedEntrancePointIndex = i; break; } } } else { selectedEntrancePointIndex = 0; selectedEntrancePointIndex = -1; } } error = new GUIStyle(); error.normal.textColor = Color.red; //Get Available Buttons availableInputs.Clear(); availableInputs = E_Helpers.GetAllInputAxis(); base.OnEnable(); }
public override void OnInspectorGUI() { #region Core base.OnInspectorGUI(); DrawTitleBar( "Network Respawning", "Call \"Respawn\" function on this component to respawn the player across the network. \n\n" + "Best if called from the \"Respawn\" function found in the \"Sync Player\" component. " + "Can have the \"OnDead\" event on the \"vThirdPersonController\" component call the " + "\"Respawn\" function of the \"SyncPlayer\" component. \n\n" + "Will respawn the player (destroying the old one) based on the settings here. Will respawn " + "the player with max health but all the previous settings that were originally on the player, " + "including their inventory settings.", E_Core.h_respawnPointIcon ); #endregion #region Properties if (E_Helpers.InspectorTagExists("RespawnPoint") == false) { EditorGUILayout.HelpBox("There is no tag\"RespawnPoint\" in this project! \n\n" + "To add a new object that is tagged with \"RespawnPoint\" go to CB Games > Network Manager > Respawn > Add Respawn Point", MessageType.Error); } else if (GameObject.FindGameObjectWithTag("RespawnPoint") == null) { EditorGUILayout.HelpBox("There is no gameobject with the \"RespawnPoint\" tag in this scene! \n\n" + "To add a new object that is tagged with \"RespawnPoint\" go to CB Games > Network Manager > Respawn > Add Respawn Point", MessageType.Error); } else { EditorGUILayout.PropertyField(respawnDelay); EditorGUILayout.PropertyField(visualCountdown); GUILayout.Space(10); EditorGUILayout.PropertyField(respawnType); if (respawnType.enumValueIndex == 1) { EditorGUILayout.PropertyField(respawnPoint); if (respawnPoint.objectReferenceValue == null) { EditorGUILayout.HelpBox("There must always be a transform here otherwise this player will not respawn correctly.", MessageType.Error); } } if (respawnType.enumValueIndex == 3) { EditorGUILayout.PropertyField(teams, true); } GUILayout.Space(10); EditorGUILayout.PropertyField(broadcastDeathMessage); if (broadcastDeathMessage.boolValue == true) { EditorGUILayout.PropertyField(deathMessage); } EditorGUILayout.Space(); EditorGUILayout.PropertyField(debugging); } #endregion EndInspectorGUI(typeof(PlayerRespawn)); }
private void OnEnable() { if (!_skin) { _skin = E_Helpers.LoadSkin(E_Core.e_guiSkinPathZRace); } _titleColor = new Color32(1, 9, 28, 255); nickname = serializedObject.FindProperty("nickname"); setNamePlayer = serializedObject.FindProperty("setNamePlayer"); OnNameResult = serializedObject.FindProperty("OnNameResult"); }
private void OnEnable() { if (!_skin) { _skin = E_Helpers.LoadSkin(E_Core.e_guiSkinPathZRace); } transformPlayer = serializedObject.FindProperty("transformPlayer"); targetPlayer = serializedObject.FindProperty("targetPlayer"); AddScore = serializedObject.FindProperty("AddScore"); tagsToDetect = serializedObject.FindProperty("tagsToDetect"); controllerToCheck = serializedObject.FindProperty("controllerToCheck"); checkIsDead = serializedObject.FindProperty("checkIsDead"); }
protected override void OnEnable() { #region Properties keyToSwitchPrevious = serializedObject.FindProperty("keyToSwitchPrevious"); keyToSwitchNext = serializedObject.FindProperty("keyToSwitchNext"); deathVisual = serializedObject.FindProperty("deathVisual"); OnEnableSwitching = serializedObject.FindProperty("OnEnableSwitching"); OnDisableSwitching = serializedObject.FindProperty("OnDisableSwitching"); #endregion availableInputs = E_Helpers.GetAllInputAxis(); base.OnEnable(); }
protected override void OnEnable() { #region Fields isPlayer = serializedObject.FindProperty("isPlayer"); ifOnTeam = serializedObject.FindProperty("ifOnTeam"); speakerImage = serializedObject.FindProperty("speakerImage"); recordingImage = serializedObject.FindProperty("recordingImage"); debugging = serializedObject.FindProperty("debugging"); pushToTalk = serializedObject.FindProperty("pushToTalk"); buttonToPress = serializedObject.FindProperty("buttonToPress"); OnConnectedToServer = serializedObject.FindProperty("OnConnectedToServer"); OnDisconnect = serializedObject.FindProperty("OnDisconnect"); OnJoinRoom = serializedObject.FindProperty("OnJoinRoom"); OnStart = serializedObject.FindProperty("OnStart"); #endregion availableInputs = E_Helpers.GetAllInputAxis(); base.OnEnable(); }
private void OnEnable() { if (!_skin) { _skin = E_Helpers.LoadSkin(E_Core.e_guiSkinPathZRace); } colorHealthHigh = serializedObject.FindProperty("colorHealthHigh"); colorHealthMidHigh = serializedObject.FindProperty("colorHealthMidHigh"); colorHealthMid = serializedObject.FindProperty("colorHealthMid"); colorHealthMidLow = serializedObject.FindProperty("colorHealthMidLow"); colorHealthLow = serializedObject.FindProperty("colorHealthLow"); valueHealthHigh = serializedObject.FindProperty("valueHealthHigh"); valueHealthMidHigh = serializedObject.FindProperty("valueHealthMidHigh"); valueHealthMid = serializedObject.FindProperty("valueHealthMid"); valueHealthMidLow = serializedObject.FindProperty("valueHealthMidLow"); valueHealthLow = serializedObject.FindProperty("valueHealthLow"); healthValue = serializedObject.FindProperty("healthValue"); imageColor = serializedObject.FindProperty("imageColor"); }
protected override void OnEnable() { #region Properties content = serializedObject.FindProperty("content"); rootObj = serializedObject.FindProperty("rootObj"); playerJoinObject = serializedObject.FindProperty("playerJoinObject"); openWindow = serializedObject.FindProperty("openWindow"); keyToPress = serializedObject.FindProperty("keyToPress"); autoCloseWithChatBox = serializedObject.FindProperty("autoCloseWithChatBox"); delayDisable = serializedObject.FindProperty("delayDisable"); anim = serializedObject.FindProperty("anim"); openAnimation = serializedObject.FindProperty("openAnimation"); closeAnimation = serializedObject.FindProperty("closeAnimation"); soundSource = serializedObject.FindProperty("soundSource"); openSound = serializedObject.FindProperty("openSound"); openSoundVolume = serializedObject.FindProperty("openSoundVolume"); closeSound = serializedObject.FindProperty("closeSound"); closeSoundVolume = serializedObject.FindProperty("closeSoundVolume"); debugging = serializedObject.FindProperty("debugging"); #endregion availableInputs = E_Helpers.GetAllInputAxis(); base.OnEnable(); }
protected override void OnEnable() { #region Properties #region Sounds Options source = serializedObject.FindProperty("source"); chatNotification = serializedObject.FindProperty("chatNotification"); notificationVolume = serializedObject.FindProperty("notificationVolume"); #endregion #region Animation Options chatAnim = serializedObject.FindProperty("chatAnim"); slideIn = serializedObject.FindProperty("slideIn"); slideOut = serializedObject.FindProperty("slideOut"); #endregion #region ChatBox GameObjects parentChatObj = serializedObject.FindProperty("parentChatObj"); msgInput = serializedObject.FindProperty("msgInput"); connectionStatus = serializedObject.FindProperty("connectionStatus"); messagesObj = serializedObject.FindProperty("messagesObj"); scrollRect = serializedObject.FindProperty("scrollRect"); newMessageIcon = serializedObject.FindProperty("newMessageIcon"); onlyWhenWindowClose = serializedObject.FindProperty("onlyWhenWindowClose"); #endregion #region Dynamically Generate Objects otherChatMessage = serializedObject.FindProperty("otherChatMessage"); yourChatMessage = serializedObject.FindProperty("yourChatMessage"); #endregion #region External Objects References nm = serializedObject.FindProperty("nm"); #endregion #region Helpful ChatBox Actions autoScroll = serializedObject.FindProperty("autoScroll"); startEnabled = serializedObject.FindProperty("startEnabled"); enableOnConnect = serializedObject.FindProperty("enableOnConnect"); debugging = serializedObject.FindProperty("debugging"); #endregion #region Connection Settings chatChannel = serializedObject.FindProperty("chatChannel"); protocol = serializedObject.FindProperty("protocol"); region = serializedObject.FindProperty("region"); authType = serializedObject.FindProperty("authType"); #endregion #region Input Settings openChatWindowOnPress = serializedObject.FindProperty("openChatWindowOnPress"); closeWindowOnPress = serializedObject.FindProperty("closeWindowOnPress"); sendChatOnPress = serializedObject.FindProperty("sendChatOnPress"); #endregion #region UnityEvents OnReceiveBroadcastMessage = serializedObject.FindProperty("OnReceiveBroadcastMessage"); OnYouSubscribeToAnyChannel = serializedObject.FindProperty("OnYouSubscribeToAnyChannel"); OnYouUnSubscribeFromAnyChannel = serializedObject.FindProperty("OnYouUnSubscribeFromAnyChannel"); ReceivedAnyChatMessage = serializedObject.FindProperty("ReceivedAnyChatMessage"); ReceivedOtherPlayerChatMessage = serializedObject.FindProperty("ReceivedOtherPlayerChatMessage"); ChatEnabled = serializedObject.FindProperty("ChatEnabled"); ChatDisabled = serializedObject.FindProperty("ChatDisabled"); OnUserSubscribedToDataChannel = serializedObject.FindProperty("OnUserSubscribedToDataChannel"); OnUserUnSubscribedToDataChannel = serializedObject.FindProperty("OnUserUnSubscribedToDataChannel"); OnYouSubscribeToDataChannel = serializedObject.FindProperty("OnYouSubscribeToDataChannel"); #endregion #endregion #region Dropdowns showHelpFullChatActions = serializedObject.FindProperty("showHelpFullChatActions"); showInputSettings = serializedObject.FindProperty("showInputSettings"); showConnectionSettings = serializedObject.FindProperty("showConnectionSettings"); showExternalObjectRef = serializedObject.FindProperty("showExternalObjectRef"); showDynamicGenObj = serializedObject.FindProperty("showDynamicGenObj"); showChatBoxObjs = serializedObject.FindProperty("showChatBoxObjs"); showAnimSettings = serializedObject.FindProperty("showAnimSettings"); showSoundSettings = serializedObject.FindProperty("showSoundSettings"); eventSettings = serializedObject.FindProperty("eventSettings"); #endregion #region Event Booleans dataEvents = serializedObject.FindProperty("dataEvents"); subscribeEvents = serializedObject.FindProperty("subscribeEvents"); messageEvents = serializedObject.FindProperty("messageEvents"); enableEvents = serializedObject.FindProperty("enableEvents"); #endregion availableInputs = E_Helpers.GetAllInputAxis(); base.OnEnable(); }