예제 #1
0
        // Use this for initialization
        void Start()
        {

            HungerBar.value = HungerStartValue;
            HungerBar = GameObject.Find("HungerBar").GetComponent<UnityEngine.UI.Slider>();

        }
예제 #2
0
	public void Start ()
	{
		//Initializes on start up to listen for messages
		//make sure this game object has both UDPPackIO and OSC script attached
		
		UDPPacketIO udp = (UDPPacketIO)GetComponent("UDPPacketIO");
		udp.init(RemoteIP, SendToPort, ListenerPort);
		handler = (Osc)GetComponent("Osc");
		handler.init(udp);
		handler.SetAllMessageHandler(AllMessageHandler);


		tornadoSlider = GameObject.Find("Tornado Slider").GetComponent<UnityEngine.UI.Slider>();
		munchkinSlider = GameObject.Find("Munchkin Slider").GetComponent<UnityEngine.UI.Slider>();
		poppySlider = GameObject.Find("Poppy Slider").GetComponent<UnityEngine.UI.Slider>();
		monkeySlider = GameObject.Find("Monkey Slider").GetComponent<UnityEngine.UI.Slider>();
		fireSlider = GameObject.Find("Fire Slider").GetComponent<UnityEngine.UI.Slider>();
		transSpeedSlider = GameObject.Find("Transition Slider").GetComponent<UnityEngine.UI.Slider>();


		nv = GameObject.Find("Network").GetComponent<NetworkView>();

		Debug.Log("Osc Running");
		
	}
예제 #3
0
 void Start()
 {
     m_slider = GetComponent<UnityEngine.UI.Slider>();
     if (m_slider == null)
     {
         Debug.LogError("Could not find slider");
     }
 }
예제 #4
0
		public override void OnEnter()
		{
			GameObject _go = Fsm.GetOwnerDefaultTarget(gameObject);
			if (_go!=null)
			{
				_slider = _go.GetComponent<UnityEngine.UI.Slider>();
			}

			DoGetValue();

		}
 private void TyrantGetComponents()
 {
     Content_Type = this.GetComponentInChild<Tyrant.ComponentsForUnity.DataBinding.ItemsContainerForUnity>("Scroll View/Viewport/Content");
     DialogPanel_Rows = this.GetComponentInChild<UnityEngine.RectTransform>("Dialog Panel");
     Content_Rows = this.GetComponentInChild<Tyrant.ComponentsForUnity.DataBinding.ItemsContainerForUnity>("Dialog Panel/Main Content/Scroll View/Viewport/Content");
     Loading_Process = this.GetComponentInChild<UnityEngine.UI.Slider>("Loading Process");
     DialogPanel_RowDetail = this.GetComponentInChild<UnityEngine.RectTransform>("Dialog Panel (1)");
     Content_RowDetail = this.GetComponentInChild<Tyrant.ComponentsForUnity.DataBinding.ItemsContainerForUnity>("Dialog Panel (1)/Main Content/Scroll View/Viewport/Content");
     SystemInfoBtn = this.GetComponentInChild<UnityEngine.UI.Button>("SystemInfo");
     DialogPanel_SysInfo = this.GetComponentInChild<UnityEngine.RectTransform>("Dialog Panel (2)");
     Content_SysInfo = this.GetComponentInChild<UnityEngine.RectTransform>("Dialog Panel (2)/Main Content/Scroll View/Viewport/Content");
     QuitBtn = this.GetComponentInChild<UnityEngine.UI.Button>("QuitBtn");
 }
 private void OnDestroyComponents()
 {
     Content_Type = null;
     DialogPanel_Rows = null;
     Content_Rows = null;
     Loading_Process = null;
     DialogPanel_RowDetail = null;
     Content_RowDetail = null;
     SystemInfoBtn = null;
     DialogPanel_SysInfo = null;
     Content_SysInfo = null;
     QuitBtn = null;
 }
		public override void OnEnter()
		{

			GameObject _go = Fsm.GetOwnerDefaultTarget(gameObject);
			if (_go!=null)
			{
				_slider = _go.GetComponent<UnityEngine.UI.Slider>();
			}

			if (resetOnExit.Value)
			{
				_originalValue = _slider.direction;
			}

			DoSetValue();
		}
		public override void OnEnter()
		{
			GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
			if (go!=null)
			{
				_slider = go.GetComponent<UnityEngine.UI.Slider>();
				if (_slider!=null)
				{
					_slider.onValueChanged.AddListener(DoOnValueChanged);
				}else{
					LogError("Missing UI.Slider on "+go.name);
				}
			}else{
				LogError("Missing GameObject");
			}

		}
예제 #9
0
    void Start()
    {
        if (PickPanel == null) PickPanel = this.transform;
        color0 = PickPanel.Find("colorLast/color0").GetComponent<UnityEngine.UI.RawImage>();
        color1 = PickPanel.Find("color1").GetComponent<UnityEngine.UI.RawImage>();
        sc = PickPanel.Find("SliderSC").GetComponent<UnityEngine.UI.Slider>();
        sr = PickPanel.Find("SliderR").GetComponent<UnityEngine.UI.Slider>();
        sg = PickPanel.Find("SliderG").GetComponent<UnityEngine.UI.Slider>();
        sb = PickPanel.Find("SliderB").GetComponent<UnityEngine.UI.Slider>();
        vr = PickPanel.Find("ValueR").GetComponent<UnityEngine.UI.InputField>();
        vg = PickPanel.Find("ValueG").GetComponent<UnityEngine.UI.InputField>();
        vb = PickPanel.Find("ValueB").GetComponent<UnityEngine.UI.InputField>();
        m = PickPanel.Find("m/Quad");
        initPicker();

        colorIndexTex = new Texture2D(16, 16, TextureFormat.ARGB32, false);
        colorIndexTex.filterMode = FilterMode.Point;
        InitDefPalette();
        InitPalette();
    }
		public override void OnEnter()
		{

			GameObject _go = Fsm.GetOwnerDefaultTarget(gameObject);
			if (_go!=null)
			{
				_slider = _go.GetComponent<UnityEngine.UI.Slider>();
			}

			if (resetOnExit.Value)
			{
				_originalValue = _slider.normalizedValue;
			}

			DoSetValue();
			
			if (!everyFrame)
			{
				Finish();
			}
		}
예제 #11
0
	// Use this for initialization
	void Start () {
		animationOnMusic = GameObject.Find("On_Music").GetComponent<Animator >();
		animationOffMusic = GameObject.Find("Off_Music").GetComponent<Animator >();
		animationNoobDif = GameObject.Find("Noob").GetComponent<Animator >();
		animationNormalDif = GameObject.Find("Normal").GetComponent<Animator >();
		animationWindow = GameObject.Find("Window").GetComponent<Animator >();
		animationFullscreen = GameObject.Find("Fullscreen").GetComponent<Animator >();
		animationMusic = GameObject.Find("Music").GetComponent<Animator >();
		animationVolume = GameObject.Find("Volume").GetComponent<Animator >();
		animationDifficulty = GameObject.Find("Difficulty").GetComponent<Animator >();
		animationMode = GameObject.Find("Mode").GetComponent<Animator >();
		animationApply = GameObject.Find("Apply").GetComponent<Animator >();
		animationCancel = GameObject.Find("Cancel").GetComponent<Animator >();
		musicAudio = GameObject.Find("Main Camera").GetComponent<AudioSource >();
		volume = GameObject.Find("Slider").GetComponent<UnityEngine.UI.Slider >();
		animationMusic.SetBool("selectedMusic", true);
		animationOnMusic.SetBool("selectedOnMusic", true);
		animationNoobDif.SetBool("selectedNoob", true);
		animationWindow.SetBool("selectedWindow", true);

		LoadOptions ();
	
	}
예제 #12
0
 public void SetOpenJaw(UnityEngine.UI.Slider slider)
 {
     m_openJaw = slider.value;
 }
예제 #13
0
        //----------------------------------------------------
        //UI interactions


        public void SetCloseEyes(UnityEngine.UI.Slider slider)
        {
            m_closeEyes = slider.value;
        }
예제 #14
0
 public void ChangeCurrentVolume(UnityEngine.UI.Slider volumeSlider)
 {
     ChangeCurrentVolume(volumeSlider.value);
 }
예제 #15
0
        private static List<ModelProperties> GetGamelistFromMameXML(string filePath, string fileName, EmulatorProperties emulatorProperties, UnityEngine.UI.Slider slider = null)
        {
            if (filePath == null)
            {
                filePath = ArcadeManager.applicationPath + "/3darcade~/Configuration/MasterGamelists/mame/";
            }
            if (fileName == null)
            {
                fileName = "mame.xml";
            }

            string emulatorExtension = emulatorProperties.extension;
            string emulatorID = emulatorProperties.id;
            string emulatorGamePath = ArcadeManager.applicationPath + emulatorProperties.gamePath;
            var gamesCollection = Mame2003XML.Mame.Load(Path.Combine(filePath, fileName));
            INIFile ini = new INIFile(Path.Combine(ArcadeManager.applicationPath + "/3darcade~/Configuration/MasterGamelists/mame/", emulatorID + ".ini"));
            //Debug.Log("mame " + gamesCollection.Game.Count);
            // Debug.Log("invaders is " + gamesCollection.Game.Where(x => x.Name.ToLower() == "invaders").ToList<mame2003XML.Game>()[0].Genre);
            List<ModelProperties> gamelist = new List<ModelProperties>();
            foreach (Mame2003XML.Game game in gamesCollection.Game)
            {
                ModelProperties model = new ModelProperties();
                model.descriptiveName = game.Description;
                model.id = game.Name;
                model.idParent = game.Cloneof;
                model.emulator = emulatorID.Replace(" ", String.Empty).ToLower();
                //model.animationType = "Never";
                model.animatedTextureSpeed = 2.0f;
                model.screen = (game.Video != null ? game.Video.Screen + " " : "") + (game.Video != null ? game.Video.Orientation : "");
                model.manufacturer = game.Manufacturer;
                model.year = game.Year;
                model.genre = ini.GetValue("Category", model.id, "").Replace("* Mature *", "");
                model.mature = ini.GetValue("Category", model.id, "").Contains("Mature") ? true : false;
                model.runnable = game.Driver != null ? game.Driver.Status == "good" : false;
                model.available = IsGameAvailable(emulatorGamePath, model.id, emulatorExtension);
                gamelist.Add(model);
            }
            if (gamelist.Count > 0)
            {
                return gamelist;
            }
            return null;
        }
예제 #16
0
        private void CreateAudioElements()
        {
            UIElement ui = new UIElement();

            ui.SetLocation((0.75f * UIScaler.GetWidthUnits()) - 5, 8, 10, 2);
            ui.SetText(MUSIC);
            ui.SetFont(game.gameType.GetHeaderFont());
            ui.SetFontSize(UIScaler.GetMediumFont());

            float  mVolume;
            string vSet = game.config.data.Get("UserConfig", "music");

            float.TryParse(vSet, out mVolume);
            if (vSet.Length == 0)
            {
                mVolume = 1;
            }

            GameObject musicSlideObj = new GameObject("musicSlide");

            musicSlideObj.tag = Game.DIALOG;
            musicSlideObj.transform.SetParent(game.uICanvas.transform);
            musicSlide = musicSlideObj.AddComponent <UnityEngine.UI.Slider>();
            RectTransform musicSlideRect = musicSlideObj.GetComponent <RectTransform>();

            musicSlideRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, 11 * UIScaler.GetPixelsPerUnit(), 2 * UIScaler.GetPixelsPerUnit());
            musicSlideRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, ((0.75f * UIScaler.GetWidthUnits()) - 7) * UIScaler.GetPixelsPerUnit(), 14 * UIScaler.GetPixelsPerUnit());
            musicSlide.onValueChanged.AddListener(delegate { UpdateMusic(); });
            new RectangleBorder(musicSlideObj.transform, Color.white, new Vector2(musicSlideRect.rect.width / UIScaler.GetPixelsPerUnit(), musicSlideRect.rect.height / UIScaler.GetPixelsPerUnit()));

            GameObject musicFill = new GameObject("musicfill");

            musicFill.tag = Game.DIALOG;
            musicFill.transform.SetParent(musicSlideObj.transform);
            musicFill.AddComponent <UnityEngine.UI.Image>();
            musicFill.GetComponent <UnityEngine.UI.Image>().color = Color.white;
            musicSlide.fillRect           = musicFill.GetComponent <RectTransform>();
            musicSlide.fillRect.offsetMin = Vector2.zero;
            musicSlide.fillRect.offsetMax = Vector2.zero;

            // Double slide is a hack because I can't get a click in the space to work otherwise
            GameObject musicSlideObjRev = new GameObject("musicSlideRev");

            musicSlideObjRev.tag = Game.DIALOG;
            musicSlideObjRev.transform.SetParent(game.uICanvas.transform);
            musicSlideRev = musicSlideObjRev.AddComponent <UnityEngine.UI.Slider>();
            RectTransform musicSlideRectRev = musicSlideObjRev.GetComponent <RectTransform>();

            musicSlideRectRev.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, 11 * UIScaler.GetPixelsPerUnit(), 2 * UIScaler.GetPixelsPerUnit());
            musicSlideRectRev.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, ((0.75f * UIScaler.GetWidthUnits()) - 7) * UIScaler.GetPixelsPerUnit(), 14 * UIScaler.GetPixelsPerUnit());
            musicSlideRev.onValueChanged.AddListener(delegate { UpdateMusicRev(); });
            musicSlideRev.direction = UnityEngine.UI.Slider.Direction.RightToLeft;

            GameObject musicFillRev = new GameObject("musicfillrev");

            musicFillRev.tag = Game.DIALOG;
            musicFillRev.transform.SetParent(musicSlideObjRev.transform);
            musicFillRev.AddComponent <UnityEngine.UI.Image>();
            musicFillRev.GetComponent <UnityEngine.UI.Image>().color = Color.clear;
            musicSlideRev.fillRect           = musicFillRev.GetComponent <RectTransform>();
            musicSlideRev.fillRect.offsetMin = Vector2.zero;
            musicSlideRev.fillRect.offsetMax = Vector2.zero;


            musicSlide.value    = mVolume;
            musicSlideRev.value = 1 - mVolume;

            ui = new UIElement();
            ui.SetLocation((0.75f * UIScaler.GetWidthUnits()) - 5, 14, 10, 2);
            ui.SetText(EFFECTS);
            ui.SetFont(game.gameType.GetHeaderFont());
            ui.SetFontSize(UIScaler.GetMediumFont());

            float eVolume;

            vSet = game.config.data.Get("UserConfig", "effects");
            float.TryParse(vSet, out eVolume);
            if (vSet.Length == 0)
            {
                eVolume = 1;
            }

            GameObject effectSlideObj = new GameObject("effectSlide");

            effectSlideObj.tag = Game.DIALOG;
            effectSlideObj.transform.SetParent(game.uICanvas.transform);
            effectSlide = effectSlideObj.AddComponent <UnityEngine.UI.Slider>();
            RectTransform effectSlideRect = effectSlideObj.GetComponent <RectTransform>();

            effectSlideRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, 17 * UIScaler.GetPixelsPerUnit(), 2 * UIScaler.GetPixelsPerUnit());
            effectSlideRect.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, ((0.75f * UIScaler.GetWidthUnits()) - 7) * UIScaler.GetPixelsPerUnit(), 14 * UIScaler.GetPixelsPerUnit());
            effectSlide.onValueChanged.AddListener(delegate { UpdateEffects(); });
            EventTrigger.Entry entry = new EventTrigger.Entry();
            entry.eventID = EventTriggerType.PointerUp;
            entry.callback.AddListener(delegate { PlayTestSound(); });
            effectSlideObj.AddComponent <EventTrigger>().triggers.Add(entry);
            new RectangleBorder(effectSlideObj.transform, Color.white, new Vector2(effectSlideRect.rect.width / UIScaler.GetPixelsPerUnit(), effectSlideRect.rect.height / UIScaler.GetPixelsPerUnit()));

            GameObject effectFill = new GameObject("effectFill");

            effectFill.tag = Game.DIALOG;
            effectFill.transform.SetParent(effectSlideObj.transform);
            effectFill.AddComponent <UnityEngine.UI.Image>();
            effectFill.GetComponent <UnityEngine.UI.Image>().color = Color.white;
            effectSlide.fillRect           = effectFill.GetComponent <RectTransform>();
            effectSlide.fillRect.offsetMin = Vector2.zero;
            effectSlide.fillRect.offsetMax = Vector2.zero;

            // Double slide is a hack because I can't get a click in the space to work otherwise
            GameObject effectSlideObjRev = new GameObject("effectSlideRev");

            effectSlideObjRev.tag = Game.DIALOG;
            effectSlideObjRev.transform.SetParent(game.uICanvas.transform);
            effectSlideRev = effectSlideObjRev.AddComponent <UnityEngine.UI.Slider>();
            RectTransform effectSlideRectRev = effectSlideObjRev.GetComponent <RectTransform>();

            effectSlideRectRev.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Top, 17 * UIScaler.GetPixelsPerUnit(), 2 * UIScaler.GetPixelsPerUnit());
            effectSlideRectRev.SetInsetAndSizeFromParentEdge(RectTransform.Edge.Left, ((0.75f * UIScaler.GetWidthUnits()) - 7) * UIScaler.GetPixelsPerUnit(), 14 * UIScaler.GetPixelsPerUnit());
            effectSlideRev.onValueChanged.AddListener(delegate { UpdateEffectsRev(); });
            effectSlideRev.direction = UnityEngine.UI.Slider.Direction.RightToLeft;
            effectSlideObjRev.AddComponent <EventTrigger>().triggers.Add(entry);

            GameObject effectFillRev = new GameObject("effectFillRev");

            effectFillRev.tag = Game.DIALOG;
            effectFillRev.transform.SetParent(effectSlideObjRev.transform);
            effectFillRev.AddComponent <UnityEngine.UI.Image>();
            effectFillRev.GetComponent <UnityEngine.UI.Image>().color = Color.clear;
            effectSlideRev.fillRect           = effectFillRev.GetComponent <RectTransform>();
            effectSlideRev.fillRect.offsetMin = Vector2.zero;
            effectSlideRev.fillRect.offsetMax = Vector2.zero;

            effectSlide.value    = eVolume;
            effectSlideRev.value = 1 - eVolume;
        }
예제 #17
0
 // Use this for initialization
 void Start()
 {
     health = player.GetComponent <HealthManager>();
     slider = GetComponent <UnityEngine.UI.Slider>();
 }
예제 #18
0
        internal Toy(string name, string id)
        {
            this.id   = id;
            this.name = name;

            button = ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, name + "\nClick to\nSet", "Click to set controll mode", (ButtonAPI.HorizontalPosition) x ++, ButtonAPI.VerticalPosition.BottomButton, ButtonAPI.MakeEmptyPage("SubMenu_1").transform, delegate(bool a)
            {
                changeHand();
            }, Color.white, Color.magenta, null, true, false, false, false, null, true);

            toys.Add(this);

            GameObject slider    = GameObject.Find("UserInterface/QuickMenu/UserInteractMenu/User Volume/VolumeSlider");
            GameObject quickmenu = GameObject.Find("UserInterface/QuickMenu/ShortcutMenu");

            GameObject speedSliderObject = GameObject.Instantiate(slider, quickmenu.transform, true);

            speedSlider              = speedSliderObject.GetComponent <UnityEngine.UI.Slider>();
            speedSlider.maxValue     = 20;
            speedSlider.wholeNumbers = true;
            speedSlider.value        = 0;
            speedSliderText          = speedSlider.transform.Find("Fill Area/VolumeNumberText").GetComponent <UnityEngine.UI.Text>();
            speedSliderText.text     = name + " Speed: 0%";
            speedSliderObject.SetActive(false);

            if (name.Equals("Max"))
            {
                GameObject maxSliderObject = GameObject.Instantiate(slider, quickmenu.transform, true);
                maxSliderObject.transform.localScale = new Vector3(0.7f, 1, 1);
                maxSlider              = maxSliderObject.GetComponent <UnityEngine.UI.Slider>();
                maxSlider.maxValue     = 3;
                maxSlider.wholeNumbers = true;
                maxSlider.value        = 0;
                Transform textTransform = maxSlider.transform.Find("Fill Area/VolumeNumberText");
                textTransform.localScale = new Vector3(1, 1, 1);
                maxSliderText            = textTransform.GetComponent <UnityEngine.UI.Text>();
                maxSliderText.text       = "Max Contraction: 0";
                maxSliderObject.SetActive(false);
            }
            else if (name.Equals("Nora"))
            {
                rotateButton = ButtonAPI.CreateButton(ButtonAPI.ButtonType.Default, "Rotate", "Rotate Nora", ButtonAPI.HorizontalPosition.LeftOfMenu, ButtonAPI.VerticalPosition.BelowBottomButton, ButtonAPI.ShortcutMenuTransform, delegate(bool a)
                {
                    rotate();
                }, Color.white, Color.magenta, null, true, false, false, false, null, true);
                rotateButton.gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(720, 190);
                rotateButton.gameObject.SetActive(false);
            }
            else if (name.Equals("Edge"))
            {
                speedSlider.GetComponent <RectTransform>().sizeDelta = new Vector2(850, 160);
                GameObject edgeSliderObject = GameObject.Instantiate(slider, quickmenu.transform, true);
                edgeSliderObject.GetComponent <RectTransform>().sizeDelta = new Vector2(850, 160);
                edgeSlider              = edgeSliderObject.GetComponent <UnityEngine.UI.Slider>();
                edgeSlider.maxValue     = 20;
                edgeSlider.wholeNumbers = true;
                edgeSlider.value        = 0;
                Transform textTransform = edgeSlider.transform.Find("Fill Area/VolumeNumberText");
                textTransform.localScale = new Vector3(1, 1, 1);
                edgeSliderText           = textTransform.GetComponent <UnityEngine.UI.Text>();
                edgeSliderText.text      = "Edge Speed: 0%";
                edgeSliderObject.SetActive(false);
            }
        }
예제 #19
0
        public static EmulatorConfiguration UpdateMasterGamelistFromEmulatorConfiguration(EmulatorConfiguration emulatorConfiguration, UnityEngine.UI.Slider slider = null)
        {
            List<ModelProperties> masterGamelist;
            Debug.Log("Updating emulator configuration " + emulatorConfiguration.emulator.descriptiveName + " with id " + emulatorConfiguration.emulator.id);
            // Mame xml?
            string fileName = emulatorConfiguration.emulator.id + ".xml";
            string filePath = ArcadeManager.applicationPath + "/3darcade~/Configuration/MasterGamelists/mame/";
            if (FileManager.FileExists(filePath, fileName) != null)
            {
                var md5 = FileManager.FileMD5Changed(emulatorConfiguration.md5MasterGamelist, filePath, fileName);
                if (md5 != null)
                {
                    masterGamelist = GetGamelistFromMameXML(filePath, fileName, emulatorConfiguration.emulator, slider);
                    if (masterGamelist != null)
                    {
                        emulatorConfiguration.lastMasterGamelistUpdate = DateTime.Now.ToString();
                        emulatorConfiguration.masterGamelist = masterGamelist;
                        emulatorConfiguration.md5MasterGamelist = md5;
                        Debug.Log("MasterGamelist updated from mame xml");
                    }
                    else
                    {
                        Debug.Log("MasterGamelist update failed from mame xml");
                    }
                }
                else
                {
                    Debug.Log("MasterGamelist is current, updated from mame xml is not needed");
                }
                return emulatorConfiguration;
            }

            // Hyperspin xml?
            fileName = emulatorConfiguration.emulator.id + ".xml";
            filePath = ArcadeManager.applicationPath + "/3darcade~/Configuration/MasterGamelists/hyperspin/";
            if (FileManager.FileExists(filePath, fileName) != null)
            {
                var md5 = FileManager.FileMD5Changed(emulatorConfiguration.md5MasterGamelist, filePath, fileName);
                if (md5 != null)
                {
                    masterGamelist = GetGamelistFromHyperspinXML(filePath, fileName, emulatorConfiguration.emulator, slider);
                    if (masterGamelist != null)
                    {
                        emulatorConfiguration.lastMasterGamelistUpdate = DateTime.Now.ToString();
                        emulatorConfiguration.masterGamelist = masterGamelist;
                        emulatorConfiguration.md5MasterGamelist = md5;
                        Debug.Log("MasterGamelist updated from atf");
                    }
                    else
                    {
                        Debug.Log("MasterGamelist update failed from hyperpsin xml");
                    }
                }
                else
                {
                    Debug.Log("MasterGamelist is current, updated from hyperspin xml is not needed");
                }
                return emulatorConfiguration;
            }

            // 3darcade atf?
            fileName = emulatorConfiguration.emulator.id + ".atf";
            filePath = ArcadeManager.applicationPath + "/3darcade~/Configuration/MasterGamelists/atf/";
            if (FileManager.FileExists(filePath, fileName) != null)
            {
                var md5 = FileManager.FileMD5Changed(emulatorConfiguration.md5MasterGamelist, filePath, fileName);
                if (md5 != null)
                {
                    masterGamelist = GetGamelistFrom3DArcadeATF(filePath, fileName, emulatorConfiguration.emulator, slider);
                    if (masterGamelist != null)
                    {
                        emulatorConfiguration.lastMasterGamelistUpdate = DateTime.Now.ToString();
                        emulatorConfiguration.masterGamelist = masterGamelist;
                        emulatorConfiguration.md5MasterGamelist = md5;
                        Debug.Log("MasterGamelist updated from 3darcade atf");
                    }
                    else
                    {
                        Debug.Log("MasterGamelist update failed from 3darcade atf");
                    }
                }
                else
                {
                    Debug.Log("MasterGamelist is current, updated from 3darcade atf is not needed");
                }
                return emulatorConfiguration;
            }

            // from folder?
            string gamePath = emulatorConfiguration.emulator.gamePath.Trim();
            filePath = ArcadeManager.applicationPath + gamePath;
           
          
            // if (FileManager.DirectoryExists(filePath) != null)
            //  {
            masterGamelist = GetGamelistFromGamePath(filePath, emulatorConfiguration.emulator, slider);
                if (masterGamelist != null)
                {
                    emulatorConfiguration.lastMasterGamelistUpdate = DateTime.Now.ToString();
                    emulatorConfiguration.masterGamelist = masterGamelist;
                    emulatorConfiguration.md5MasterGamelist = "";
                    Debug.Log("MasterGamelist updated from game path");
                    return emulatorConfiguration;
                }
                else
                {
                    Debug.Log("MasterGamelist update failed from game path");
                }
          //  }
            Debug.Log("MasterGamelist not found");
            return emulatorConfiguration;
        }
예제 #20
0
 void Start()
 {
     this.volumeSlider = GetComponentInParent<UnityEngine.UI.Slider>();
     volumeSlider.value = audioSource.volume;
 }
예제 #21
0
 private static List<ModelProperties> GetGamelistFromGamePath(string filePath, EmulatorProperties emulatorProperties, UnityEngine.UI.Slider slider = null)
 {
     string emulatorExtension = emulatorProperties.extension;
     string emulatorID = emulatorProperties.id;
    
     if (!emulatorExtension.Contains(".") && emulatorExtension != "") { emulatorExtension = "." + emulatorExtension; }
     if (emulatorExtension == "") { emulatorExtension = "*.*"; }
     var files = FileManager.FilesFromDirectory(filePath, emulatorExtension);
     if (files != null)
     {
         List<ModelProperties> gamelist = new List<ModelProperties>();
         foreach (FileInfo file in files)
         {
             string fileName = Path.GetFileNameWithoutExtension(file.FullName);
             ModelProperties model = new ModelProperties();
             model.descriptiveName = fileName;
             model.id = fileName;
             model.idParent = "";
             model.emulator = emulatorID.Replace(" ", String.Empty).ToLower();
             //model.animationType = "Never";
             model.animatedTextureSpeed = 2.0f;
             gamelist.Add(model);
         }
         if (gamelist.Count > 0)
         {
             return gamelist;
         }
     }
     return null;
 }
예제 #22
0
        private static List<ModelProperties> GetGamelistFrom3DArcadeATF(string filePath, string fileName, EmulatorProperties emulatorProperties, UnityEngine.UI.Slider slider = null)
        {
            string emulatorExtension = emulatorProperties.extension;
            string emulatorID = emulatorProperties.id;
            string emulatorGamePath = ArcadeManager.applicationPath + emulatorProperties.gamePath;

            var text = FileManager.LoadTextFromFile(filePath, fileName);
            if (text == null) { return null; }
            var lines = text.Split(Environment.NewLine.ToCharArray());
            //   | Description | Name | Year | Manufacturer | Clone | Romof | Category | VersionAdded | Available | Emulator | Type | Model | Favorites | Video | Orientation | Resolution | Aspect | Frequency | Depth | Stereo | Controltype | Buttons | Players | Coins | Driver | DriverStatus | SoundStatus | ColorStatus | HtmlLinks | TimesPlayed | DurationPlayed | Rating |||||
            List<ModelProperties> gamelist = new List<ModelProperties>();
            foreach (string line in lines)
            {
                var items = line.Split("|".ToCharArray());
                if (items.Count() < 35) { continue; }
                ModelProperties model = new ModelProperties();
                model.descriptiveName = items[1];
                model.id = items[2];
                model.idParent = items[5] != "none" && items[5] != "" ? items[5] : "";
                model.emulator = emulatorID.Replace(" ", String.Empty).ToLower();
                model.model = items[12] != "none" && items[12] != "" ? items[12] : "";
                //model.animationType = "Never";
                model.animatedTextureSpeed = 2.0f;
                model.screen = (items[14] != "none" && items[14] != "" ? items[14] + " " : "") + items[15] != "none" && items[15] != "" ? items[15] : "";
                model.manufacturer = items[4] != "none" && items[4] != "" ? items[4] : "";
                model.year = items[3] != "none" && items[3] != "" ? items[3] : "";
                model.genre = items[7] != "none" && items[7] != "" ? items[7].Replace("*Mature*", "") : "";
                model.available = items[9].ToLower() != "no" ? true : false;
                int number;
                model.playCount = int.TryParse(items[30], out number) ? number : 0;
                model.mature = items[7].ToLower().Contains("mature") ? true : false;
                model.available = IsGameAvailable(emulatorGamePath, model.id, emulatorExtension);
                gamelist.Add(model);
            }
            if (gamelist.Count > 0)
            {
                return gamelist;
            }
            return null;
        }
예제 #23
0
        private static List<ModelProperties> GetGamelistFromHyperspinXML(string filePath, string fileName, EmulatorProperties emulatorProperties, UnityEngine.UI.Slider slider = null)
        {
            string emulatorExtension = emulatorProperties.extension;
            string emulatorID = emulatorProperties.id;
            string emulatorGamePath = ArcadeManager.applicationPath + emulatorProperties.gamePath;

            var gamesCollection = HyperspinXML.Menu.Load(Path.Combine(filePath, fileName));
            //Debug.Log("invaders is " + gamesCollection.Game.Where(x => x.Name.ToLower() == "invaders").ToList<HyperspinXML.Game>()[0].Genre);
            List<ModelProperties> gamelist = new List<ModelProperties>();
            foreach (HyperspinXML.Game game in gamesCollection.Game)
            {
                ModelProperties model = new ModelProperties();
                model.descriptiveName = game.Description;
                model.id = game.Name;
                model.idParent = game.Cloneof;
                model.emulator = emulatorID.Replace(" ", String.Empty).ToLower();
                //model.animationType = "Never";
                model.animatedTextureSpeed = 2.0f;
                model.manufacturer = game.Manufacturer;
                model.year = game.Year;
                model.genre = game.Genre;
                model.available = IsGameAvailable(emulatorGamePath, model.id, emulatorExtension);
                // model.mature = game.Rating;
                gamelist.Add(model);
            }
            if (gamelist.Count > 0)
            {
                return gamelist;
            }
            return null;
        }
예제 #24
0
 public void SetFireIntensity(UnityEngine.UI.Slider slider)
 {
     m_fireIntensity = slider.value;
 }
예제 #25
0
 private void Awake()
 {
     _RenderDistanceSlider          = GetComponent <UnityEngine.UI.Slider>();
     _RenderDistanceSlider.maxValue = 16;
     _RenderDistanceSlider.onValueChanged.AddListener(RenderDistanceSliderValueChanged);
 }
예제 #26
0
 public void SetHeadLookAtWeight(UnityEngine.UI.Slider slider)
 {
     m_headLook.weight = slider.value;
 }
예제 #27
0
 // Use this for initialization
 void Start()
 {
     healthSlider = this.gameObject.GetComponentInChildren<UnityEngine.UI.Slider> ();
     healthText = healthSlider.GetComponentInChildren<UnityEngine.UI.Text> ();
     ps = gameObject.GetComponentInParent<PlayerStats> ();
 }
예제 #28
0
 public void SetVolumeSlider(UnityEngine.UI.Slider slider)
 {
     BusVolume = slider.value;
 }
 /// <summary>Tweens a Slider's value to the given value.
 /// Also stores the Slider as the tween's target so it can be used for filtered operations</summary>
 /// <param name="endValue">The end value to reach</param><param name="duration">The duration of the tween</param>
 /// <param name="snapping">If TRUE the tween will smoothly snap all values to integers</param>
 public static Tweener DOValue(this UnityEngine.UI.Slider target, float endValue, float duration, bool snapping = false)
 {
     return(DOTween.To(() => target.value, x => target.value = x, endValue, duration)
            .SetOptions(snapping).SetTarget(target));
 }
예제 #30
0
 public void AssignColorsToSelection(GameObject gameObject)
 {
     recursiveLevel++;
     if (gameObject.GetComponent <UnityEngine.UI.Button>())
     {
         UnityEngine.UI.Button button = gameObject.GetComponent <UnityEngine.UI.Button>();
         SetColorBlock(button);
         SetDetailColor(gameObject);
         EditorUtility.SetDirty(button);
     }
     else if (gameObject.GetComponent <UnityEngine.UI.InputField>())
     {
         UnityEngine.UI.InputField input = gameObject.GetComponent <UnityEngine.UI.InputField>();
         SetColorBlock(input);
         input.selectionColor = highlighted;
         Undo.RecordObject(input.textComponent, "Change Text color");
         input.textComponent.color = pressed;
         Undo.RecordObject(input.placeholder, "Change Placeholder color");
         input.placeholder.color = highlighted;
         EditorUtility.SetDirty(input);
         EditorUtility.SetDirty(input.textComponent);
         EditorUtility.SetDirty(input.placeholder);
     }
     else if (gameObject.GetComponent <UnityEngine.UI.Scrollbar>())
     {
         UnityEngine.UI.Scrollbar sb = gameObject.GetComponent <UnityEngine.UI.Scrollbar>();
         SetColorBlock(sb);
         Undo.RecordObject(gameObject.GetComponent <UnityEngine.UI.Image>(), "Change Image color");
         gameObject.GetComponent <UnityEngine.UI.Image>().color = disabled;
         EditorUtility.SetDirty(sb);
         EditorUtility.SetDirty(gameObject.GetComponent <UnityEngine.UI.Image>());
     }
     else if (gameObject.GetComponent <UnityEngine.UI.Slider>())
     {
         UnityEngine.UI.Slider slider = gameObject.GetComponent <UnityEngine.UI.Slider>();
         SetColorBlock(slider);
         Undo.RecordObject(slider.fillRect.gameObject.GetComponent <UnityEngine.UI.Image>(), "Change Image color");
         slider.fillRect.gameObject.GetComponent <UnityEngine.UI.Image>().color = normal;
         SetTextColorRecursive(gameObject);
         EditorUtility.SetDirty(slider);
         EditorUtility.SetDirty(slider.fillRect.gameObject.GetComponent <UnityEngine.UI.Image>());
     }
     else if (gameObject.GetComponent <UnityEngine.UI.Toggle>())
     {
         UnityEngine.UI.Toggle toggle = gameObject.GetComponent <UnityEngine.UI.Toggle>();
         SetColorBlock(toggle);
         Undo.RecordObject(toggle.graphic, "Change Image color");
         toggle.graphic.color = normal;
         SetTextColorRecursive(gameObject);
         EditorUtility.SetDirty(toggle);
         EditorUtility.SetDirty(toggle.graphic);
     }
     else if (gameObject.transform.childCount > 0) // Recursive search for components
     {
         for (int i = 0; i < gameObject.transform.childCount; i++)
         {
             AssignColorsToSelection(gameObject.transform.GetChild(i).gameObject);
         }
     }
     else if (recursiveLevel == 1)
     {
         if (gameObject.GetComponent <UnityEngine.UI.Image>())
         {
             UnityEngine.UI.Image image = gameObject.GetComponent <UnityEngine.UI.Image>();
             Undo.RecordObject(image, "Change color");
             image.color = normal;
             EditorUtility.SetDirty(image);
         }
         else if (gameObject.GetComponent <UnityEngine.UI.Text>())
         {
             UnityEngine.UI.Text text = gameObject.GetComponent <UnityEngine.UI.Text>();
             Undo.RecordObject(text, "Change color");
             text.color = normal;
             EditorUtility.SetDirty(text);
         }
     }
 }
        protected override bool ExecCommand(StoryInstance instance, long delta)
        {
            UnityEngine.GameObject obj = m_Obj.Value as UnityEngine.GameObject;
            if (null != obj)
            {
                UiStoryInitializer initer = obj.GetComponent <UiStoryInitializer>();
                if (null != initer)
                {
                    UiStoryEventHandler handler = obj.GetComponent <UiStoryEventHandler>();
                    if (null == handler)
                    {
                        handler = obj.AddComponent <UiStoryEventHandler>();
                    }
                    if (null != handler)
                    {
                        int ct = m_VarInfos.Count;
                        for (int ix = 0; ix < ct; ++ix)
                        {
                            string name = m_VarInfos[ix].m_VarName.Value;
                            string path = m_VarInfos[ix].m_ControlPath.Value;
                            UnityEngine.GameObject ctrl = Utility.FindChildObjectByPath(obj, path);
                            AddVariable(instance, name, ctrl);
                        }

                        handler.WindowName = initer.WindowName;
                        var list = m_Inputs;
                        for (int k = 0; k < list.Count; ++k)
                        {
                            string path = list[k].Value;
                            var    comp = Utility.FindComponentInChildren <UnityEngine.UI.InputField>(obj, path);
                            handler.InputLabels.Add(comp);
                        }
                        list = m_Toggles;
                        for (int k = 0; k < list.Count; ++k)
                        {
                            string path = list[k].Value;
                            var    comp = Utility.FindComponentInChildren <UnityEngine.UI.Toggle>(obj, path);
                            handler.InputToggles.Add(comp);
                        }
                        list = m_Sliders;
                        for (int k = 0; k < list.Count; ++k)
                        {
                            string path = list[k].Value;
                            var    comp = Utility.FindComponentInChildren <UnityEngine.UI.Slider>(obj, path);
                            handler.InputSliders.Add(comp);
                        }
                        list = m_DropDowns;
                        for (int k = 0; k < list.Count; ++k)
                        {
                            string path = list[k].Value;
                            var    comp = Utility.FindComponentInChildren <UnityEngine.UI.Dropdown>(obj, path);
                            handler.InputDropdowns.Add(comp);
                        }

                        ct = m_EventInfos.Count;
                        for (int ix = 0; ix < ct; ++ix)
                        {
                            string evt  = m_EventInfos[ix].m_Event.Value;
                            string tag  = m_EventInfos[ix].m_Tag.Value;
                            string path = m_EventInfos[ix].m_Path.Value;
                            if (evt == "button")
                            {
                                UnityEngine.UI.Button button = Utility.FindComponentInChildren <UnityEngine.UI.Button>(obj, path);
                                button.onClick.AddListener(() => { handler.OnClickHandler(tag); });
                            }
                            else if (evt == "toggle")
                            {
                                UnityEngine.UI.Toggle toggle = Utility.FindComponentInChildren <UnityEngine.UI.Toggle>(obj, path);
                                toggle.onValueChanged.AddListener((bool val) => { handler.OnToggleHandler(tag, val); });
                            }
                            else if (evt == "dropdown")
                            {
                                UnityEngine.UI.Dropdown dropdown = Utility.FindComponentInChildren <UnityEngine.UI.Dropdown>(obj, path);
                                dropdown.onValueChanged.AddListener((int val) => { handler.OnDropdownHandler(tag, val); });
                            }
                            else if (evt == "slider")
                            {
                                UnityEngine.UI.Slider slider = Utility.FindComponentInChildren <UnityEngine.UI.Slider>(obj, path);
                                slider.onValueChanged.AddListener((float val) => { handler.OnSliderHandler(tag, val); });
                            }
                            else if (evt == "input")
                            {
                                UnityEngine.UI.InputField input = Utility.FindComponentInChildren <UnityEngine.UI.InputField>(obj, path);
                                input.onEndEdit.AddListener((string val) => { handler.OnInputHandler(tag, val); });
                            }
                        }
                    }
                }
            }
            return(false);
        }
예제 #32
0
 public virtual void Awake()
 {
     slider = GetComponent <UnityEngine.UI.Slider>();
 }
예제 #33
0
    // Use this for initialization
    void Start()
    {
        //We can come from the game into this menu. In the game the cursor is hidden. Force it visible to be sure.
        Cursor.visible = true;

        //Get the canvas
        thisCanvas = GetComponent<Canvas>();

        //Get the Canvas groups for the different sub-menus
        welcomeGroup = transform.Find("Group_Welcome").gameObject.GetComponent<CanvasGroup>();
        welcomeGroup.interactable = false;
        commonsMenuGroup = transform.Find("Group_Commons").gameObject.GetComponent<CanvasGroup>();
        commonsMenuGroup.interactable = false;
        mainMenuGroup = transform.Find("Group_MainMenu").gameObject.GetComponent<CanvasGroup>();
        mainMenuGroup.interactable = false;
        optionsMenuGroup = transform.Find("Group_OptionsMenu").gameObject.GetComponent<CanvasGroup>();
        optionsMenuGroup.interactable = false;

        //Get the dynamic elements from welcome screen
        clickText = welcomeGroup.transform.Find("Text_ClicktoBegin").gameObject.GetComponent<UnityEngine.UI.Text>();

        //Get the interactive elements from options screen
        graphSlider = optionsMenuGroup.transform.Find("Graph_Quality_Slider").gameObject.GetComponent<UnityEngine.UI.Slider>();
        graphSlider.value = QualitySettings.GetQualityLevel();

        subtitleToggle = optionsMenuGroup.transform.Find("Subtitle_Toggle").gameObject.GetComponent<UnityEngine.UI.Toggle>();

        //Reads subtitles preferences in "preferences" save file. 0 if no value. Checkbox is changed accordingly.
        if ( PlayerPrefs.GetInt("subtitles", 0) == 1 ) {
            subtitleToggle.isOn = true;
        }
        else
        {
            subtitleToggle.isOn = false;
        }

        PlayerPrefs.SetInt("subtitles", 0);

        //Modify size of background image to make sure it fills screen
        RectTransform backgroundSize = gameObject.transform.Find("BackgroundImage").gameObject.GetComponent<RectTransform>();
        backgroundSize.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, Screen.width);
        backgroundSize.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, Screen.height);

        //Setup the black fader to fill the screen
        blackFader = transform.Find("BlackFader").gameObject.GetComponent<UnityEngine.UI.Image>();
        blackFader.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, Screen.width);
        blackFader.rectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, Screen.height);

        //Fetch and store menu audio source
        audioSrc = GetComponent<AudioSource>();

        //Start first step : showing the Unity logo. It starts the chain of events
        StartCoroutine("ShowGobelinsLogo");
    }
예제 #34
0
 void Start()
 {
     slider = GetComponent <UnityEngine.UI.Slider>();
 }
예제 #35
0
    void Start()
    {
        //set UI elements
        cohSlider = GameObject.Find("slider_Cohesion").GetComponent<UnityEngine.UI.Slider>();
        sepSlider = GameObject.Find("slider_Separation").GetComponent<UnityEngine.UI.Slider>();
        alignSlider = GameObject.Find("slider_Alignment").GetComponent<UnityEngine.UI.Slider>();
        tendSlider = GameObject.Find("slider_TendToPlace").GetComponent<UnityEngine.UI.Slider>();

        cohSlider.value = cohesionCoefficient;
        sepSlider.value = seperationCoefficient;
        alignSlider.value = alignmentCoefficient;
        tendSlider.value = tendToPlaceCoefficient;

        //zero vector used to instantiate Boids
        Vector3 pos = new Vector3(0, 0, 0);

        //instantiate prefab boids
        for (int i = 0; i < boidCount; ++i)
        {
            GameObject g = Instantiate(Boid, pos, Quaternion.identity) as GameObject;
            g.name = "Boid" + i;
            Boids.Add(g);
        }

        //parent boids to a game object, set random positions and velocities
        foreach (GameObject b in Boids)
        {
            b.transform.parent = gameObject.transform;
            b.transform.position = new Vector3(Random.Range(randomMin, randomMax),
                                   Random.Range(randomMin, randomMax), Random.Range(randomMin, randomMax));

            b.GetComponent<Boid>().velocity = new Vector3(Random.Range(-1, 1), Random.Range(-1, 1), Random.Range(-1, 1));
        }

        //populate Predators list with predators in the scene
        foreach (GameObject g in FindObjectsOfType<GameObject>())
        {
            if (g.GetComponent<Predator>())
            {
                Predators.Add(g);
            }
        }
    }
 private void AddSlider()
 {
     slider = gameObject.AddComponent <UnityEngine.UI.Slider>();
 }
예제 #37
0
 void Awake()
 {
     slider = gameObject.GetComponent<UnityEngine.UI.Slider>();
 }
예제 #38
0
	public override void Awake()
	{
		base.Awake();
		_UiSliderReceiver = GetComponent<UISlider>();
		_slider = GetComponent<UnityEngine.UI.Slider> ();
	}
예제 #39
0
 // Start is called before the first frame update
 void Start()
 {
     radiusSlider = GetComponentInChildren <UnityEngine.UI.Slider>();
 }
예제 #40
0
 void Start()
 {
     _Slider = GetComponent<UnityEngine.UI.Slider>();
 }
 void Awake()
 {
     m_slider = GetComponent <UnityEngine.UI.Slider> ();
 }