public void OnWindFilterChanged(UnityEngine.UI.Toggle toggle) { for (int i = 0; i < World.Size * World.Size; i++) { _windArrows[i].SetActive(toggle.isOn); } }
public void SetGameObject(UnityEngine.GameObject @object) { gameObject = @object; toggle = GameObject.GetComponent <UnityEngine.UI.Toggle>(); GameObject.transform.Find("Content").GetComponent <UnityEngine.UI.RawImage>().texture = Data; toggle.onValueChanged.AddListener(delegate { ToggleValueChanged(Toggle); }); }
static int NotifyToggleOn(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 2) { UnityEngine.UI.ToggleGroup obj = (UnityEngine.UI.ToggleGroup)ToLua.CheckObject <UnityEngine.UI.ToggleGroup>(L, 1); UnityEngine.UI.Toggle arg0 = (UnityEngine.UI.Toggle)ToLua.CheckObject <UnityEngine.UI.Toggle>(L, 2); obj.NotifyToggleOn(arg0); return(0); } else if (count == 3) { UnityEngine.UI.ToggleGroup obj = (UnityEngine.UI.ToggleGroup)ToLua.CheckObject <UnityEngine.UI.ToggleGroup>(L, 1); UnityEngine.UI.Toggle arg0 = (UnityEngine.UI.Toggle)ToLua.CheckObject <UnityEngine.UI.Toggle>(L, 2); bool arg1 = LuaDLL.luaL_checkboolean(L, 3); obj.NotifyToggleOn(arg0, arg1); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: UnityEngine.UI.ToggleGroup.NotifyToggleOn")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
void Start() { string version = Application.version; if (version != null) { versionCodeField.text = "v " + version; } deviceName.text = "Device name: " + PersistentData.Instance.serverLogin.deviceName; expirationDate.text = "Expiration date: " + PersistentData.Instance.serverLogin.expiredDay; expirationDate.text += "/" + PersistentData.Instance.serverLogin.expiredMonth; expirationDate.text += "/" + PersistentData.Instance.serverLogin.expiredDay; debbugField.text = ""; foreach (VoicesManager.AvailableLang al in VoicesManager.Instance.availableLangs) { UnityEngine.UI.Toggle t = Instantiate(toggleButton); t.GetComponent <ToogleCustom>().Init(al.lang, al.available); t.transform.SetParent(container); t.transform.localScale = Vector3.one; t.transform.localEulerAngles = Vector3.zero; t.transform.localPosition = Vector3.zero; buttons.Add(t); } }
static public int set_onValueChanged(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif UnityEngine.UI.Toggle self = (UnityEngine.UI.Toggle)checkSelf(l); UnityEngine.UI.Toggle.ToggleEvent v; checkType(l, 2, out v); self.onValueChanged = v; pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
static public int Rebuild(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif UnityEngine.UI.Toggle self = (UnityEngine.UI.Toggle)checkSelf(l); UnityEngine.UI.CanvasUpdate a1; a1 = (UnityEngine.UI.CanvasUpdate)LuaDLL.luaL_checkinteger(l, 2); self.Rebuild(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
static public int SetIsOnWithoutNotify(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif UnityEngine.UI.Toggle self = (UnityEngine.UI.Toggle)checkSelf(l); System.Boolean a1; checkType(l, 2, out a1); self.SetIsOnWithoutNotify(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
private void AddScriptListItem(string scriptName) { Vector3 position = ScriptListContent.GetComponent <RectTransform>().position; var newElement = Instantiate(ScriptListItemPrefab, position, Quaternion.identity, ScriptListContent.transform); newElement.GetComponent <RectTransform>().localScale = new Vector3(1, 1, 1); // for some reasons it scales to big sizes newElement.GetComponent <TextMeshProUGUI>().text = scriptName; Toggle itemToggle = newElement.GetComponent <Toggle>(); itemToggle.group = ScriptListContent.GetComponent <ToggleGroup>(); itemToggle.onValueChanged.AddListener(val => { if (val) { Debug.Log($"BeltScriptMenu: Selected {scriptName}"); m_currentSelection = scriptName; } else { m_currentSelection = null; } }); m_scriptListItems.Add(newElement); }
void Start() { generateError = GameObject.Find("GenerateErrorToggle").GetComponent <Toggle>(); status = GameObject.Find("Status").GetComponent <Text>(); Debug.Assert(status != null && generateError != null); #if UNITY_EDITOR //STEP1: In your real project this should happen in App.xaml.cs and you will instantiata different factory.. Microsoft.UnityPlugins.MicrosoftAdsBridge.InterstitialAdFactory = new EditorAdFactory(); #else generateError.interactable = false; generateError.transform.FindChild("Label").GetComponent <Text>().color = new Color(0, 0, 0, 0); #endif ad = MicrosoftAdsBridge.InterstitialAdFactory.CreateAd(OnAdReady, OnAdCompleted, OnAdCancelled, OnAdError); #if UNITY_EDITOR //This is not needed in production.. here we use it to show a fake ad so you can work your // workflow of stopping pausing to play ad, unpausing, etc.. ((EditorInterstitialAd)ad).syncMonoBehaviour = this; var canvas = GameObject.Find("Canvas").GetComponent <Canvas>(); ((EditorInterstitialAd)ad).canvas = canvas; #endif }
static public int GraphicUpdateComplete(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif UnityEngine.UI.Toggle self = (UnityEngine.UI.Toggle)checkSelf(l); self.GraphicUpdateComplete(); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
static int AddToggleClick(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 3 && TypeChecker.CheckTypes <UnityEngine.GameObject, LuaInterface.LuaFunction>(L, 2)) { LuaBehaviour obj = (LuaBehaviour)ToLua.CheckObject <LuaBehaviour>(L, 1); UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.ToObject(L, 2); LuaFunction arg1 = ToLua.ToLuaFunction(L, 3); obj.AddToggleClick(arg0, arg1); return(0); } else if (count == 3 && TypeChecker.CheckTypes <UnityEngine.UI.Toggle, LuaInterface.LuaFunction>(L, 2)) { LuaBehaviour obj = (LuaBehaviour)ToLua.CheckObject <LuaBehaviour>(L, 1); UnityEngine.UI.Toggle arg0 = (UnityEngine.UI.Toggle)ToLua.ToObject(L, 2); LuaFunction arg1 = ToLua.ToLuaFunction(L, 3); obj.AddToggleClick(arg0, arg1); return(0); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to method: LuaBehaviour.AddToggleClick")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void linkUI() { //Main Panel for script tabNewPanel = AppModel.Instance.tabNewPanel; //View buttonSend = tabNewPanel.transform.FindDeepChild("SendButton").gameObject.GetComponent <UnityEngine.UI.Button>(); buttonReceive = tabNewPanel.transform.FindDeepChild("ReceiveButton").gameObject.GetComponent <UnityEngine.UI.Button>(); buttonAdd = tabNewPanel.transform.FindDeepChild("AddButton").gameObject.GetComponent <UnityEngine.UI.Button>(); toggleSend = tabNewPanel.transform.FindDeepChild("SendToggle").gameObject.GetComponent <UnityEngine.UI.Toggle>(); toggleReceive = tabNewPanel.transform.FindDeepChild("ReceiveToggle").gameObject.GetComponent <UnityEngine.UI.Toggle>(); buttonSend.onClick.AddListener(onClickSend); buttonReceive.onClick.AddListener(onClickReceive); buttonAdd.onClick.AddListener(onClickAddConnection); //NetworkModel receiveIP = tabNewPanel.transform.FindDeepChild("ReceiveIP").gameObject.GetComponent <UnityEngine.UI.Dropdown>(); receivePort = tabNewPanel.transform.FindDeepChild("ReceivePort").gameObject.GetComponent <UnityEngine.UI.InputField>(); destinationIP = tabNewPanel.transform.FindDeepChild("DestinationIP").gameObject.GetComponent <UnityEngine.UI.InputField>(); destinationPort = tabNewPanel.transform.FindDeepChild("DestinationPort").gameObject.GetComponent <UnityEngine.UI.InputField>(); scrollAreaText = tabNewPanel.transform.FindDeepChild("InfoScrollArea").gameObject.GetComponentInChildren <UnityEngine.UI.Text>(); dataField = tabNewPanel.transform.FindDeepChild("DataField").gameObject.GetComponentInChildren <UnityEngine.UI.InputField>(); //TODO:move refreshReceiveIPDropdown to some more appropiate place refreshReceiveIPDropdown(); }
public void SetEnabled(UiToggle toggle) { if (toggle.isOn) { Global.particleQuality = this.particleQuality; } }
public override void OnStartLocalPlayer() { //dice_roll = new List<Die> (); //TODO Add setup system for starting amount of chips ready_button = GetComponentInChildren <UnityEngine.UI.Toggle>(); //opponent_value = GetComponentInChildren<UnityEngine.UI.Text> (); ClearRoll(); _name = GameObject.FindGameObjectWithTag("player_settings").GetComponent <data_hold>().player_name; Destroy(GameObject.FindGameObjectWithTag("player_settings")); UnityEngine.UI.Text[] text = GetComponentsInChildren <UnityEngine.UI.Text> (); for (int i = 0; i < text.Length; i++) { if (text [i].tag == "current_pot") { curr_pot = text[i]; } if (text [i].tag == "current_chip") { current_chip_count = text [i]; } if (text [i].tag == "Name_Field") { text [i].text = _name; } } value_image = GetComponentInChildren <UnityEngine.UI.Image> (); //TODO change for multiple opponents CmdAddPlayer(this.gameObject, _name); }
static int GraphicUpdateComplete(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 1); UnityEngine.UI.Toggle obj = (UnityEngine.UI.Toggle)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UnityEngine.UI.Toggle"); obj.GraphicUpdateComplete(); return(0); }
protected override void ClearUIComponents() { BtnBack = null; ImgWaterMask = null; TextAttendanceScoreConfig = null; BtnAttendance = null; ImageAttendanceDone = null; TextPunchScoreConfig = null; TextPunchScoreShareConfig = null; BtnPunch = null; TextSignInDayNum = null; TextClockNum = null; TextTaskShareNum = null; BtnTaskRule = null; MedalScrollView = null; TextMedalStudyDaysNum = null; TextMedalNum = null; TextMedalShareNum = null; BtnMedalRule = null; ToggleDailyTask = null; ToggleDailyMedal = null; BtnIntegralRule = null; BtnIntegral = null; TextIntegralNum = null; BtnExchange = null; mData = null; }
/// <summary> /// Sets the difficulty when the toggle is turned on. /// </summary> void ToggleValueChanged(UnityEngine.UI.Toggle change) { if (change.isOn) { SettingsManager.SetDifficulty(difficulty); } }
public void OnRainToggle(UnityEngine.UI.Toggle toggle) { weather.SetActive(toggle.isOn); terrain.SetActive(!toggle.isOn); snow.SetActive(!toggle.isOn); rain.SetActive(toggle.isOn); }
public void OnRayCastHit() { Debug.Log(transform.name); gameObjectName = transform.name; if (gameObjectName.Equals("Play")) { spotifyManagerScript.ResumePlayback(); } else if (gameObjectName.Equals("Pause")) { spotifyManagerScript.PausePlayback(); } else if (gameObjectName.Equals("ForwardLeft")) { spotifyManagerScript.SkipPlaybackToPrevious(); } else if (gameObjectName.Equals("ForwardRight")) { spotifyManagerScript.SkipPlaybackToNext(); } else if (gameObjectName.Equals("SetShuffle")) { spotifyManagerScript.SetShuffle(); } else if (gameObjectName.Equals("SetRepeatMode")) { spotifyManagerScript.SetRepeatMode(); } else if (gameObjectName.Equals("PlayOnClick")) { UnityEngine.UI.Toggle toggle = gameObject.GetComponent <UnityEngine.UI.Toggle>(); if (toggle.isOn) { raycast.playOnClick = false; toggle.isOn = false; Debug.Log("Play on click set to false"); } else { raycast.playOnClick = true; toggle.isOn = true; Debug.Log("Play on click set to false"); } } else if (gameObjectName.Equals("Reload")) { saveLoad.Reload(); } else if (gameObjectName.Equals("GetRecommendations")) { Debug.Log("Calling GetRecommendations from lefthandui"); recommenderDeckScript.GetRecommendations(); } else { Debug.LogError("Cannot find UI Gameobject by name"); } }
static public int set_graphic(IntPtr l) { UnityEngine.UI.Toggle o = (UnityEngine.UI.Toggle)checkSelf(l); UnityEngine.UI.Graphic v; checkType(l, 2, out v); o.graphic = v; return(0); }
static public int set_toggleTransition(IntPtr l) { UnityEngine.UI.Toggle o = (UnityEngine.UI.Toggle)checkSelf(l); UnityEngine.UI.Toggle.ToggleTransition v; checkEnum(l, 2, out v); o.toggleTransition = v; return(0); }
static public int set_group(IntPtr l) { UnityEngine.UI.Toggle o = (UnityEngine.UI.Toggle)checkSelf(l); UnityEngine.UI.ToggleGroup v; checkType(l, 2, out v); o.group = v; return(0); }
static public int set_onValueChanged(IntPtr l) { UnityEngine.UI.Toggle o = (UnityEngine.UI.Toggle)checkSelf(l); UnityEngine.UI.Toggle.ToggleEvent v; checkType(l, 2, out v); o.onValueChanged = v; return(0); }
public void OnPressLeaderboards(UnityEngine.UI.Toggle toggle) { if (toggle.isOn) { Background.SetBGTargetPosition(BackgroundParallaxController.RightPosition); MainMenuUI.Instance.Navigation.ActivateScreen(ViewsNavigation.ScreenID.Leaderboard); } }
static int Rebuild(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 2); UnityEngine.UI.Toggle obj = (UnityEngine.UI.Toggle)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UnityEngine.UI.Toggle"); UnityEngine.UI.CanvasUpdate arg0 = (UnityEngine.UI.CanvasUpdate)LuaScriptMgr.GetNetObject(L, 2, typeof(UnityEngine.UI.CanvasUpdate)); obj.Rebuild(arg0); return(0); }
public Toggle AddCheckbox(bool value, string title, UnityAction <bool> save, string audio = "checkBoxClick") { Toggle button = UIElements.CreateCheckBox(panel.transform, title, save).GetComponent <Toggle>(); button.isOn = value; button.onValueChanged.AddListener((pos) => { NAudio.Play(audio); }); return(button); }
static int OnSubmit(IntPtr L) { LuaScriptMgr.CheckArgsCount(L, 2); UnityEngine.UI.Toggle obj = (UnityEngine.UI.Toggle)LuaScriptMgr.GetUnityObjectSelf(L, 1, "UnityEngine.UI.Toggle"); UnityEngine.EventSystems.BaseEventData arg0 = (UnityEngine.EventSystems.BaseEventData)LuaScriptMgr.GetNetObject(L, 2, typeof(UnityEngine.EventSystems.BaseEventData)); obj.OnSubmit(arg0); return(0); }
// Start is called before the first frame update void Start() { toggle = GetComponent <UnityEngine.UI.Toggle>(); selector.SetActive(false); toggle.onValueChanged.AddListener(delegate { ToggleValueChanged(toggle); }); }
public void OnPressMyLineup(UnityEngine.UI.Toggle toggle) { if (toggle.isOn) { Background.SetBGTargetPosition(BackgroundParallaxController.ZeroPosition); MainMenuUI.Instance.Navigation.ActivateScreen(ViewsNavigation.ScreenID.MyLineups); } }
// Use this for initialization void Start() { LE = LandmarkEnabler.GetComponent <UnityEngine.UI.Toggle>(); TE = TargetPointEnabler.GetComponent <UnityEngine.UI.Toggle>(); LE.isOn = (PlayerPrefs.GetInt("showLandmarks", 1) != 0) ? true : false; TE.isOn = (PlayerPrefs.GetInt("showTargetPoint", 0) != 0) ? true : false; }
void Start() { generateError = GameObject.Find("GenerateErrorToggle").GetComponent<Toggle>(); status = GameObject.Find("Status").GetComponent<Text>(); Debug.Assert(status != null && generateError != null); #if UNITY_EDITOR //STEP1: In your real project this should happen in App.xaml.cs and you will instantiata different factory.. Microsoft.UnityPlugins.MicrosoftAdsBridge.InterstitialAdFactory = new EditorAdFactory(); #else generateError.interactable = false; generateError.transform.FindChild("Label").GetComponent<Text>().color = new Color(0, 0, 0, 0); #endif ad = MicrosoftAdsBridge.InterstitialAdFactory.CreateAd(OnAdReady, OnAdCompleted, OnAdCancelled, OnAdError); #if UNITY_EDITOR //This is not needed in production.. here we use it to show a fake ad so you can work your // workflow of stopping pausing to play ad, unpausing, etc.. ((EditorInterstitialAd)ad).syncMonoBehaviour = this; var canvas = GameObject.Find("Canvas").GetComponent<Canvas>(); ((EditorInterstitialAd)ad).canvas = canvas ; #endif }