Example #1
0
        private void AddCustomTabLineToolbarElements()
        {
            SampleTabControl.SuspendLayout();

            try
            {
                TabControlToolbarCustomButton plusButton = new TabControlToolbarCustomButton();
                plusButton.DefaultSmallImage = Resources.TabControlCustomToolbarPlus;
                plusButton.Click += TabControlPlusButton_Click;
                SampleTabControl.AdditionalTabLineControls.Add(plusButton);

                TabControlToolbarCustomButton folderButton = new TabControlToolbarCustomButton();
                folderButton.DefaultSmallImage = Resources.TabControlCustomToolbarFolder;
                folderButton.Click += TabControlFolderButton_Click;
                SampleTabControl.AdditionalTabLineControls.Add(folderButton);

                _tabControlSlider = new Slider();
                _tabControlSlider.Size = new Size(50, _tabControlSlider.PreferredSize.Height);
                _tabControlSlider.AutoSize = false;
                _tabControlSlider.ShowMinMaxTicks = false;
                _tabControlSlider.TickStyle = TickStyle.None;
                _tabControlSlider.Style = SliderStyle.TrackBar;

                _tabControlSlider.Minimum = 0;
                _tabControlSlider.Maximum = 100;
                _tabControlSlider.Value = 20;

                SampleTabControl.AdditionalTabLineControls.Add(_tabControlSlider);
            }
            finally
            {
                SampleTabControl.ResumeLayout(false);
            }
        }
    //Called when a level is loaded
	void OnLevelWasLoaded() {
        restartTimer = 0;
        totalMinutes = 0;
        playTimer = 0;
        GameOver = false;
        if (Application.loadedLevel == 1)
        {
            theSun = GameObject.Find("spotlight").GetComponent<Light>();
            mHero = GameObject.Find("Hero").GetComponent<Hero>();
            mTimer = GameObject.Find("Timer").GetComponent<Slider>();
            mHBar = GameObject.Find("hpBar").GetComponent<Slider>();
            mMin = GameObject.Find("minCounter").GetComponent<Text>();
            mSec = GameObject.Find("secCounter").GetComponent<Text>();
            Info = GameObject.Find("Info").GetComponent<Text>();
            mPanel = GameObject.Find("Panel").GetComponent<Image>();
            mPanel.gameObject.SetActive(false);
            Info.gameObject.SetActive(false);
            if(gameType == ENDLESS || gameType == DEBUG)
            {
                mTimer.gameObject.SetActive(false);
            }
            SpawnVariableControl();
            StartCoroutine(MasterSpawner(Troll));
        }
        else
        {
            SetButtons();
        }
	}
 // Use this for initialization
 void Start()
 {
     _shipMetrics = FindObjectOfType<ShipMetrics>();
     _slider = GetComponent<Slider>();
     List<Text> texts = new List<Text>(GetComponentsInChildren<Text>());
     _text = texts.Find(text => text.name == "Number");
 }
Example #4
0
    public void addSlider(Slider resourceSlider)
    {

        slider = resourceSlider;
        if(slider != null)
            slider.value = _value / _max;
    }
Example #5
0
    void EnemyAttack()
    {
        if (tw.ce.enemySummoned) {
            if (whoMoves == 1) {
                txt = damageTakenPlayer.GetComponent<Text>();
                dice = Random.Range(1, 21);
                diceDef = Random.Range(1, 5);
                if (dice > (tw.tst.dexTotal + diceDef)) {
                    dice = Random.Range(1, 5);
                    dmg = dice + tw.ce.enemySTR - (tw.tst.conTotal / 2);
                    sld = playerLife.GetComponent<Slider>();
                    sld.value -= dmg;
                    txt.text = dmg.ToString();
                    dmg = 0;
                    whoMoves = 0;
                } else {
                    txt.text = "MISS";
                    whoMoves = 0;
                }

                damageTakenEnemy.SetActive(false);
                damageTakenPlayer.SetActive(true);
            }
        }
    }
	// 初始
	public override void Initialize()
	{
		m_RootUI = UITool.FindUIGameObject( "SoldierInfoUI" );

		// 圖像
		m_Icon = UITool.GetUIComponent<Image>(m_RootUI, "SoldierIcon");
		// 名稱
		m_NameTxt = UITool.GetUIComponent<Text>(m_RootUI, "SoldierNameText");
		// HP
		m_HPTxt = UITool.GetUIComponent<Text>(m_RootUI, "SoldierHPText");
		// 等級
		m_LvTxt = UITool.GetUIComponent<Text>(m_RootUI, "SoldierLvText");
		// Atk
		m_AtkTxt = UITool.GetUIComponent<Text>(m_RootUI, "SoldierAtkText");
		// Atk 距離
		m_AtkRangeTxt = UITool.GetUIComponent<Text>(m_RootUI, "SoldierAtkRangeText");
		// Speed
		m_SpeedTxt = UITool.GetUIComponent<Text>(m_RootUI, "SoldierSpeedText");
		// HP圖示 
		m_HPSlider = UITool.GetUIComponent<Slider>(m_RootUI, "SoldierSlider");	

		// 註冊遊戲事者
		m_PBDGame.RegisterGameEvent( ENUM_GameEvent.SoldierKilled, new SoldierKilledObserverUI( this ));
		m_PBDGame.RegisterGameEvent( ENUM_GameEvent.SoldierUpgate, new SoldierUpgateObserverUI( this ));

		Hide();
	}
Example #7
0
    void EnemyAttack()
    {
        if (tw.ce.enemySummoned) {
            if (whoMoves == 1) {
                Debug.Log("enemy atck");
                txt = damageTakenPlayer.GetComponent<Text>();
                dice = Random.Range(1, 9);
                if (dice + tw.ce.enemyLUK > tw.tst.dexTotal) {
                    dice = Random.Range(1, 5);
                    dmg = dice + tw.ce.enemySTR - ((tw.tst.conTotal / 4) * 3);
                    sld = playerLife.GetComponent<Slider>();
                    sld.value -= dmg;
                    txt.text = dmg.ToString();
                    lastDamage = dmg;
                    dmg = 0;
                    whoMoves = 0;
                } else {
                    txt.text = "MISS";
                    whoMoves = 0;
                }

                secondDamage.SetActive(false);
                damageTakenEnemy.SetActive(false);
                damageTakenPlayer.SetActive(true);
                healTaken.SetActive(false);
            }
        }
        turn++;
    }
Example #8
0
	//This function runs as soon as the application begins.
	void Start(){

		//this sets the private var baseCost to be equal to the cost, as the basecost is private and not changeable by the inspector.
		baseCost = cost;

		//this tells the slider where the slider is using a get component in children.
		_slider = GetComponentInChildren<Slider> ();

		//this gets the values we stored earlier for count and cost
		/*count = PlayerPrefs.GetInt(name);
		cost = PlayerPrefs.GetFloat(name + "c");

        if (PlayerPrefs.GetInt(name + "IsUnlocked") == 1)
        {
            IsUnlocked = true;
        }
        else
        {
            IsUnlocked = false;
        }*/

		if (cost == 0) {
			cost = baseCost;
		}

	}
	// Use this for initialization
	void Start () {
		 circles = GetComponentsInChildren<Circle>();
		 inputField = GameObject.Find("Canvas/InputField").GetComponent<InputField>();
		 stressBar = GameObject.Find("Canvas/Stress").GetComponent<Slider>();
		 audios = GetComponents<AudioSource>();

		 blackBackground = GameObject.Find("Canvas/BlackBackground");
		 gameOver = GameObject.Find("Canvas/BlackBackground/GameOver");
		 pressEnter = GameObject.Find("Canvas/BlackBackground/PressEnter");
		 gameStart = GameObject.Find("Canvas/BlackBackground/GameStart");
		 healthIndicator = GameObject.Find("Canvas/HealthIndicator").GetComponent<HealthIndicator>();

		 gameOver.SetActive(false);
		 isGameOver = true;
		 healthIndicator.SetTransparency(0f);

		 currentDay = 0;
		 taskIndex = 0;
		 dayTimer = new Timer(30f);
		 endOfDayTimer = new Timer(4f);
		 dayTimer.Reset();
		 taskTimer = new Timer(StepTimeBasedOnDay);
		 prevRandTask = 0;

		 daysData = CSVParser.Parse("Data/days");
	}
Example #10
0
        private int recallsWithGold; //TODO repair shop and remove this tempfix

        public Recall(LogicSelector currentLogic, Menu parMenu)
        {
            Menu menu = parMenu.AddSubMenu("Recall settings", "ergtrh");
            flatGold=new Slider("Minimum base gold to recall", 560, 0, 4000);
            goldPerLevel = new Slider("Minmum gold per level to recall", 70, 0, 300);
            menu.Add("mingold", flatGold);
            menu.Add("goldper", goldPerLevel);
            menu.AddSeparator(100);
            menu.AddLabel(
    @"
Example: Your champ has lvl 10
Base gold = 560
Gold per level = 70
Minimum gold = 560+70*10 = 1260

AutoBuddy won't recall if you have less gold than needed for next item.

            ");
            current = currentLogic;
            foreach (
                Obj_SpawnPoint so in
                    ObjectManager.Get<Obj_SpawnPoint>().Where(so => so.Team == ObjectManager.Player.Team))
            {
                spawn = so;
            }
            Core.DelayAction(ShouldRecall, 3000);
            if (MainMenu.GetMenu("AB").Get<CheckBox>("debuginfo").CurrentValue)
                Drawing.OnDraw += Drawing_OnDraw;
        }
Example #11
0
 public void RemoveTarget()
 {
     if (target == null)
         return;
     target.onValueChanged.RemoveListener(DisplayChanges);
     target = null;
 }
 // Use this for initialization
 void Start()
 {
     slider = GetComponent<Slider> ();
     slider.onValueChanged.AddListener ((value) => {
         musicManager.SetMusicVolume (value);
     });
 }
        public static void Main()
        {
            Window controllerWindow =
                GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.ControllerWindow));

            GlideTouch.Initialize();
            Glide.FitToScreen = true;

            Glide.MainWindow = controllerWindow;

            DirectionSlider = (Slider) controllerWindow.GetChildByName("DirectionSlider");
            DirectionSlider.ValueChangedEvent += UpdateRobotDirection;

            SpeedSlider = (Slider) controllerWindow.GetChildByName("SpeedSlider");
            SpeedSlider.ValueChangedEvent += UpdateRobotSpeed;

            var beepButton = (Button) controllerWindow.GetChildByName("BeepButton");
            beepButton.TapEvent += Beep;

            var stopButton = (Button) controllerWindow.GetChildByName("StopButton");
            stopButton.TapEvent += StopRobot;

            NrfController.OnDataReceived += HandleObstacleDetection;
            NrfController.Initialize("CONTR", "ROBOT");

            Thread.Sleep(Timeout.Infinite);
        }
        internal bool Init()
        {
            //buttons
            Button[] buttons = new Button[ 2 ];
            buttons[ 0 ] = new Button( JoystickButtons.Button1, 0 );
            buttons[ 1 ] = new Button( JoystickButtons.Button2, 1 );

            //axes
            Axis[] axes = new Axis[ 1 ];
            axes[ 0 ] = new JoystickInputDevice.Axis( JoystickAxes.X, new Range( -1, 1 ), false );

            //povs
            POV[] povs = new POV[ 0 ];
            //povs[ 0 ] = new JoystickInputDevice.POV( JoystickPOVs.POV1 );

            //sliders
            Slider[] sliders = new Slider[ 0 ];
            //sliders[ 0 ] = new Slider( JoystickSliders.Slider1 );

            //forceFeedbackController
            ForceFeedbackController forceFeedbackController = null;

            //initialize data
            InitDeviceData( buttons, axes, povs, sliders, forceFeedbackController );

            return true;
        }
Example #15
0
	protected override void Awake()
	{
		base.Awake();

        slider = GetComponent<Slider>();
		slider.value = 1f;
	}
Example #16
0
 // Use this for initialization
 void Awake()
 {
     spawnenemy = GameObject.Find("boss3spawn");
     Boss3Move.lebosspeutbouger = false;
     player = GameObject.FindGameObjectWithTag("Player");
     boss = GameObject.Find("CaveWorm");
     baril_pos_1 = GameObject.Find("baril_pos_1");
     baril_pos_2 = GameObject.Find("baril_pos_2");
     baril_pos_3 = GameObject.Find("baril_pos_3");
     baril_pos_4 = GameObject.Find("baril_pos_4");
     laser1 = GameObject.Find("laser1");
     laser2 = GameObject.Find("laser2");
     laser3 = GameObject.Find("laser3");
     laser4 = GameObject.Find("laser4");
     baril_fin = GameObject.Find("baril_fin");
     baril_start = GameObject.Find("baril_start");
     baril_start_h = GameObject.Find("baril_start_h");
     baril_pos_1_h = GameObject.Find("baril_pos_1_h");
     baril_pos_2_h = GameObject.Find("baril_pos_2_h");
     baril_pos_3_h = GameObject.Find("baril_pos_3_h");
     scriptdupersonnage = GameObject.FindGameObjectWithTag("Player").GetComponent<ScriptPersonnage>();
     enemyhealthSliderObjectGameObject = GameObject.FindGameObjectWithTag("BossHealthSlider3");
     playerHealth = player.GetComponent<PlayerHealth>();
     enemyHealth = GetComponent<EnemyHealth>();
     enemyHealthSlider = enemyhealthSliderObjectGameObject.GetComponent<Slider>(); // --
     enemyHealthSlider.maxValue = enemyHealth.startingHealth; // --
 }
    void Start()
    {
        if (_slider == null)
            _slider = (SliderProxy.FrameworkControl as Slider) ?? (SliderProxy.FrameworkControl as SliderDialog).Slider;

        if (_slider != null)
        {
            // Add slider with a tick for each configuration.

            if (Configurations != null)
            {
                var ticks = new Slider.Tick[Configurations.Length];
                for (int i = 0; i < ticks.Length; ++i)
                {
                    ticks[i] = new Slider.Tick();
                    ticks[i].Value = (float)i / (float)Configurations.Length;
                    ticks[i].Label = (i + 1).ToString();
                }
                _slider.Ticks = ticks;
                _slider.SnapsToTicks = true;

                _slider.InitialValue = (float)InitialValue / ticks.Length;
            }

            _slider.Moved += OnSliderMoved;
        }
    }
Example #18
0
    public void ChangeFloor(Slider selector)
    {
        camPOS = (int)selector.value;
        mainCam.GetComponent<CameraFollow> ().ResetView ((int)selector.value);

        for (int i = 0; i < floors.Count; i++)
        {
            if(i < (int)selector.value)
            {
                floors[i].SetActive(true);
            }
            else
            {
                floors [i].SetActive (false);
            }
        }
        if(selector.value == 1)
        {
            txtFloor.text = "Lobby";
        }
        else if(selector.value == selector.maxValue)
        {
            txtFloor.text = "Roof";
        }
        else
        {
            txtFloor.text = "Floor "+selector.value.ToString ();
        }
    }
 //----------------------------
 // set slider to represent values from 0.0 - 1.0
 // which just happens to correspond to the values received from
 // countdown time method: GetProportionTimeRemaining()
 private void SetupSlider()
 {
     sliderUI = GetComponent<Slider>();
     sliderUI.minValue = 0;
     sliderUI.maxValue = 1;
     sliderUI.wholeNumbers = false;
 }
Example #20
0
        private static void Game_OnStart(EventArgs args)
        {
            if (Player.Instance.Hero != Champion.Shaco && Player.Instance.Hero != Champion.Leblanc)
                return;

            CloneMenu = MainMenu.AddMenu("Clone control", "yodagodEOQ");
            Chat.Print(Player.Instance.ChampionName + " clone controller loaded", Color.White);

            Control = CloneMenu.Add("Clone", new CheckBox("Control clone"));
            CloneMenu.AddGroupLabel("You can select a target with left click");
            Mode = CloneMenu.Add("Mode", new Slider("", 2, 0, 2));
            Mode.DisplayName = "If health > 40%:" + Modes[Mode.CurrentValue];
            Mode.OnValueChange += delegate
                (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs Args)
            {
                sender.DisplayName = "If health > 40%:" + Modes[Args.NewValue];
            };

            Mode2 = CloneMenu.Add("Mode2", new Slider("", 0, 0, 2));
            Mode2.DisplayName = "If health < 40%:" + Modes[Mode2.CurrentValue];
            Mode2.OnValueChange += delegate
                (ValueBase<int> sender, ValueBase<int>.ValueChangeArgs Args)
            {
                sender.DisplayName = "If health < 40%:" + Modes[Args.NewValue];
            };
            Range = CloneMenu.Add("Range", new Slider("Get targets within {0} range", 2000, 1, 10000));
            

            Game.OnUpdate += ControlClone;

            GameObject.OnCreate += CreateClone;
            GameObject.OnDelete += DeleteClone;
        }
 public void EffectSlide(Slider slider)
 {
     if (OptionManager.getInstance () != null && SoundManager.getInstance () != null) {
         OptionManager.getInstance ().setEffectLevel (slider.value);
         SoundManager.getInstance ().SetEffectLevel (slider.value);
     }
 }
    void Start()
    {
        camera = Camera.main.transform;
        unit = GetComponentInParent<ClashBattleUnit>();
        slider = GetComponentInChildren<Slider>();

        var colors = new ColorBlock();
        switch (unit.species.type) {
            case ClashSpecies.SpeciesType.CARNIVORE:
                colors.normalColor = Color.red;
                break;
            case ClashSpecies.SpeciesType.HERBIVORE:
                colors.normalColor = Color.blue;
                break;
            case ClashSpecies.SpeciesType.OMNIVORE:
                colors.normalColor = Color.yellow;
                break;
            case ClashSpecies.SpeciesType.PLANT:
                colors.normalColor = Color.green;
                break;
            default: break;
        }
        colors.colorMultiplier = 1.0f;
        slider.colors = colors;
    }
Example #23
0
    public void Initialize()
    {
        Debug.Log("Initializing ControllerState");
        Screen.orientation = ScreenOrientation.LandscapeLeft;

        _backBtn = GameObject.Find(BackButton).GetComponent<Button>();
        _backBtn.onClick.AddListener(() => OnBackClick(_backBtn));

        _leftSlider = GameObject.Find(LeftSlider).GetComponent<Slider>();
        _leftSlider.value = 0;
        _leftSlider.onValueChanged.AddListener(OnLeftSliderChange);

        _rightSlider = GameObject.Find(RightSlider).GetComponent<Slider>();
        _rightSlider.value = 0;
        _rightSlider.onValueChanged.AddListener(OnRightSliderChange);

        _connected = false;
        _connecting = false;
        _zegg = _manager.GetSelectedZegg();
        if (_zegg == null) {
            Application.LoadLevel(Scenes.SCANNER);
            return;
        }

        ConnectToZegg(_zegg.Address);
    }
Example #24
0
 // Use this for initialization
 void Start()
 {
     sound = GetComponent<AudioSource>();
     mAnimator = GetComponent<Animator>();
     // スライダーを取得する
     slider = GameObject.Find("Slider").GetComponent<Slider>();
 }
Example #25
0
 void Start()
 {
     base.Init ();
     healthSlider = HealthBar.GetComponent<Slider> ();
     healthSlider.maxValue = maxHealth;
     healthSlider.value = maxHealth;
 }
    void Awake()
    {
		
        ground = GameObject.Find("Ground");
        chargeBar = GameObject.Find("Chargebar").GetComponent<Slider>();
        energyBar = GameObject.Find("EnergyBar").GetComponent<Slider>();
    }
Example #27
0
	protected override void Start()
	{
		base.Start();
		textElement = GetComponentInChildren<Text>();
		layoutElement = GetComponent<LayoutElement>();
		slider = GameObject.Find("ButtonTextSlider").GetComponent<Slider>();
	}
 // Use this for initialization
 void Start()
 {
     if (shakeSlider == null)
     {
         shakeSlider = gameObject.GetComponent<Slider>();
     }
 }
Example #29
0
	// Use this for initialization
	void Start () {
        GM = GameObject.FindGameObjectWithTag("GameController").GetComponent<GameManager>();
        sShaker = GetComponent<spriteShaker>();
        aSource = GetComponent<AudioSource>();
        sl = GM.sliderGrill;
        //sR = GetComponent<SpriteRenderer>();

        string weight = "2 Kg.";
        

        int i = Random.Range(0, 100);
        if (i < 20) {
            transform.localScale = Vector3.one * 0.75f;
            cookRatio = 2;
            weight = "1 Kg.";
        }

        if (i >80)
        {
            transform.localScale = Vector3.one * 1.5f;
            cookRatio = 0.7f;
            weight = "4 Kg.";
        }

        GM.UI.chickenWeight.text = weight;

	}
Example #30
0
    private void initUI()
    {
        //UI Initializations - Grab Canvas with find object, then grab children for efficiency
        gameUI = FindObjectOfType<Canvas>();

        //get all child sliders
        Component[] canvasSliders = gameUI.GetComponentsInChildren<Slider> ();
        //get all text sliders
        Component[] canvasTexts = gameUI.GetComponentsInChildren<Text> ();

        //loop through and find specific slider
        foreach (Slider child in canvasSliders) {
            if (child.tag.Equals("Enemy HP")) {
                enemyHealth = child;
            }
        }

        //loop through and find specific text
        foreach (Text child in canvasTexts) {
            if (child.tag.Equals("Enemy Ratio")) {
                enemyRatio = child;
            }
        }

        //create listener to run delegate function for updating text ratio of enemy
        enemyHealth.onValueChanged.AddListener (updateEnemyRatio);
    }
Example #31
0
 void Start()
 {
     bazowyKoszt = koszt;
     _slider     = GetComponentInChildren <Slider> ();
 }
Example #32
0
 private Color makeColor(Slider To_R, Slider To_G, Slider To_B)
 {
     return(new Color(To_R.value, To_G.value, To_B.value));
 }
Example #33
0
 protected virtual void Awake()
 {
     _slider = GetComponent <Slider>();
 }
Example #34
0
 private void Start()
 {
     audioSource1 = bullet.GetComponent <AudioSource>();
     audioSource2 = explosion.GetComponent <AudioSource>();
     slider       = GetComponent <Slider>();
 }
Example #35
0
 // Use this for initialization
 void Start()
 {
     tempSlider = GameObject.Find("Slider").GetComponent <Slider>();
 }
Example #36
0
 public SnakingSliderBody(Slider slider)
 {
     this.slider = slider;
 }
Example #37
0
 // Start is called before the first frame update
 void Start()
 {
     HealthBar   = GameObject.Find("HealthBar").GetComponent <Slider>();
     DamageTaken = this.gameObject.AddComponent <AudioSource>();
 }
Example #38
0
 public static void SaveChanges(Slider slider)
 {
     Pixels       = BitmapPixels(BmpImage);
     slider.Value = 0;
 }
    private void FindGameObjectWithName()
    {
        AddActiveHotspotScript = FindObjectOfType <AddActiveHotspot> ();
        Dome = GameObject.Find("DomeFull").GetComponent <SetupDome>();
        NewHotspotContainer     = GameObject.Find("NavigationCanvas");
        NewActionHotspotTemplet = GameObject.Find("ActionHotspotTemplet");
        //NewActionHotspotTemplet.transform.GetChild(0).gameObject.SetActive (true);

        Hotspot_Name          = GameObject.Find("Btn_ID").transform.GetComponent <Text> ();
        Target_Object         = GameObject.Find("Target_Object").transform.GetChild(0).transform.GetComponent <Dropdown>();
        UserAction_InputField = AddActiveHotspotScript.UserAction_InputField;
        Action_MediaFiles     = AddActiveHotspotScript.Action_MediaFiles;
        Action_UnityObjects   = AddActiveHotspotScript.Action_UnityObjects;
        ActionLable           = AddActiveHotspotScript.Action_Lable;
        ScrolFactorInput      = AddActiveHotspotScript.ScrolFactorInput;
        Action_SceneList      = AddActiveHotspotScript.Action_SceneList;
        LableBox                = AddActiveHotspotScript.LabelBoxPrfb;
        Hotspot                 = AddActiveHotspotScript.Hotspot;
        MediaFilePrfb           = AddActiveHotspotScript.MediaFilePrfb;
        UnityObject             = AddActiveHotspotScript.UnityObjectPrfb;
        ActionList_DropDown     = AddActiveHotspotScript.ActionList_DropDown;
        UserActionList_DropDown = AddActiveHotspotScript.UserActionList_DropDown;
        Always                 = AddActiveHotspotScript.Always;
        VisibleWhen            = AddActiveHotspotScript.VisibleWhen;
        Required               = AddActiveHotspotScript.Required;
        Optional               = AddActiveHotspotScript.Optional;
        XYZDropDown            = AddActiveHotspotScript.XYZDropDown;
        ObjectFunctionDropDown = AddActiveHotspotScript.ObjectFunctionDropDown;
        ScaleSlider            = AddActiveHotspotScript.ScaleSlider;
        RotationSilder         = AddActiveHotspotScript.RotationSilder;

        posx = AddActiveHotspotScript.posx;
        posy = AddActiveHotspotScript.posy;

        textPanel          = AddActiveHotspotScript.textPanel;
        navigationPanel    = AddActiveHotspotScript.navigationPanel;
        actionHotspotPanel = AddActiveHotspotScript.ActionHotspotPanal;

        ActionLable.text = "";
        Action_MediaFiles.ClearOptions();
        Action_SceneList.ClearOptions();
        Action_UnityObjects.ClearOptions();
        UserAction_InputField.text = "";


        //getPosition ();
        //GetSelectedHotspot ();
        Target_Object.value = 0;

        Action_SceneList.gameObject.SetActive(false);
        Action_MediaFiles.gameObject.SetActive(false);
        Action_UnityObjects.gameObject.SetActive(false);
        ActionLable.gameObject.SetActive(false);
        XYZDropDown.gameObject.SetActive(false);
        ObjectFunctionDropDown.gameObject.SetActive(false);
        RotationSilder.gameObject.SetActive(false);
        ScaleSlider.gameObject.SetActive(false);

        // Change
        SetupDome.UserActionName.Add(UserAction_InputField.text);
        SetupDome.ActionFunction.Add(Target_Object.captionText.text);
        SetupDome.ActionObject.Add("");


        Dome.GetComponent <SetupDome> ().Always.Add(Always.isOn);
        Dome.GetComponent <SetupDome> ().VisibleWhen.Add(VisibleWhen.isOn);
        Always.isOn      = false;
        VisibleWhen.isOn = false;
    }
Example #40
0
        // 텍스트, 슬라이더 Animation을 제어하는 함수.
        private IEnumerator SliderTextAnimation(Action <bool> SetBool, float previousValue, float newValue, float changeSpeed, Slider slider = null, Text text = null)
        {
            float currentValue = previousValue;

            SetBool(true);

            while (true)
            {
                float deltaValue = Mathf.Abs(newValue - currentValue);
                if (deltaValue <= Mathf.Abs(changeSpeed) * Time.deltaTime)
                {
                    break;
                }

                currentValue += changeSpeed * Time.deltaTime;

                if (slider != null)
                {
                    slider.value = currentValue;

                    // Color Settings
                    if (slider == _enemyHpSlider || slider == _playerHpSlider)
                    {
                        SetHealthColor(slider, currentValue, slider.maxValue);
                    }
                }
                if (text != null)
                {
                    text.text = (int)currentValue + "/" + (int)slider.maxValue;
                }

                if (currentValue <= 0f)
                {
                    newValue = 0f;
                    break;
                }

                yield return(null);
            }

            if (slider != null)
            {
                slider.value = newValue;

                // Color Settings
                if (slider == _enemyHpSlider || slider == _playerHpSlider)
                {
                    SetHealthColor(slider, currentValue, slider.maxValue);
                }
            }
            if (text != null)
            {
                text.text = (int)newValue + "/" + (int)slider.maxValue;
            }

            SetBool(false);
        }
 void SetDialogVolume(Slider volume)
 {
     _soundVolumeDialog     = volume.value;
     _dialogVolumeText.text = volume.SliderValueToPercentString();
     _audioMixer.SetFloat("Dialog", volume.value != 0 ? (DECIMAL_TO_DECIBEL * Mathf.Log10(volume.value)) : -80);
 }
Example #42
0
 void Awake()
 {
     audioMixer   = Resources.Load("Audio/MasterVolume") as AudioMixer;
     MasterVolume = GameObject.Find("Music_Volume").GetComponent <Slider>();
 }
 void SetMusicVolume(Slider volume)
 {
     _soundVolumeMusic     = volume.value;
     _musicVolumeText.text = volume.SliderValueToPercentString();
     _audioMixer.SetFloat("Music", volume.value != 0 ? (DECIMAL_TO_DECIBEL * Mathf.Log10(volume.value)) : -80);
 }
Example #44
0
 void Start()
 {
     myCanvas = this.transform.Find("Canvas").GetComponent <Canvas>();
     mySlider = myCanvas.transform.Find("Slider").GetComponent <Slider>();
 }
Example #45
0
 private void gameVolume(Slider target)
 {
     GameManager.instance.musicVolume = target.value;
 }
 void SetSFXVolume(Slider volume)
 {
     _soundVolumeSFX     = volume.value;
     _sfxVolumeText.text = volume.SliderValueToPercentString();
     _audioMixer.SetFloat("SFX", volume.value != 0 ?(DECIMAL_TO_DECIBEL * Mathf.Log10(volume.value)) : -80);
 }
Example #47
0
        private static void CreateNumberControl(DisplayNameAttribute control, PropertyInfo prop, Vector2 anchorPosition)
        {
            UIRangeAttribute rangeAttr     = prop.GetCustomAttribute <UIRangeAttribute>();
            bool             sliderControl = rangeAttr != null && rangeAttr.Slider;

            RectTransform element = Object.Instantiate(sliderControl ? sliderTemplate : inputTemplate, multiplayerContent, false);

            SetupUIElement(element, control, prop, anchorPosition);

            bool isFloatingPoint = prop.PropertyType == typeof(float) || prop.PropertyType == typeof(double);

            if (sliderControl)
            {
                Slider slider = element.GetComponentInChildren <Slider>();
                slider.minValue     = rangeAttr.Min;
                slider.maxValue     = rangeAttr.Max;
                slider.wholeNumbers = !isFloatingPoint;
                Text sliderThumbText = slider.GetComponentInChildren <Text>();
                slider.onValueChanged.RemoveAllListeners();
                slider.onValueChanged.AddListener((value) =>
                {
                    prop.SetValue(tempMultiplayerOptions, value, null);
                    sliderThumbText.text = value.ToString(isFloatingPoint ? "0.00" : "0");
                });

                tempToUICallbacks[prop.Name] = () =>
                {
                    slider.value         = (float)prop.GetValue(tempMultiplayerOptions, null);
                    sliderThumbText.text = slider.value.ToString(isFloatingPoint ? "0.00" : "0");
                };
            }
            else
            {
                InputField input = element.GetComponentInChildren <InputField>();

                input.onValueChanged.RemoveAllListeners();
                input.onValueChanged.AddListener((str) =>
                {
                    try
                    {
                        var converter            = TypeDescriptor.GetConverter(prop.PropertyType);
                        System.IComparable value = (System.IComparable)converter.ConvertFromString(str);

                        if (rangeAttr != null)
                        {
                            System.IComparable min = (System.IComparable)System.Convert.ChangeType(rangeAttr.Min, prop.PropertyType);
                            System.IComparable max = (System.IComparable)System.Convert.ChangeType(rangeAttr.Max, prop.PropertyType);
                            if (value.CompareTo(min) < 0)
                            {
                                value = min;
                            }
                            if (value.CompareTo(max) > 0)
                            {
                                value = max;
                            }
                            input.text = value.ToString();
                        }

                        prop.SetValue(tempMultiplayerOptions, value, null);
                    }
                    catch
                    {
                        // If the char is not a number, rollback to previous value
                        input.text = prop.GetValue(tempMultiplayerOptions, null).ToString();
                    }
                });

                tempToUICallbacks[prop.Name] = () =>
                {
                    input.text = prop.GetValue(tempMultiplayerOptions, null).ToString();
                };
            }
        }
Example #48
0
 // Start is called before the first frame update
 void Start()
 {
     _slider          = GetComponent <Slider>();
     _slider.maxValue = _health.Health;
     _fill.color      = _gradient.Evaluate(1f);
 }
Example #49
0
    public static string SliderValueToPercentString(this Slider slider)
    {
        int percentage = Mathf.FloorToInt(slider.value != 0 ? slider.value * (100 / slider.maxValue):0);

        return(percentage + "%");
    }
Example #50
0
        public CustomLvlSeq(Menu m, AIHeroClient champ, string dir, string seq = "", int maxlvl = 18)
        {
            locked   = new bool[] { true };
            this.dir = dir;
            se       = seq;
            Menu     menuSettings = m.AddSubMenu("Skill LvlUp", "AB_SL_SETTINGS");
            CheckBox enabled      = new CheckBox("Enabled", true);

            menuSettings.AddGroupLabel("General");
            menuSettings.Add(champ + "enabled", enabled);
            menuSettings.AddSeparator(10);
            menuSettings.AddGroupLabel("Current profile");
            profile1 = new CheckBox("Profile 1", true);
            profile2 = new CheckBox("Profile 2", false);
            menuSettings.Add(champ.ChampionName + Game.MapId + "p1", profile1);
            menuSettings.Add(champ.ChampionName + Game.MapId + "p2", profile2);

            updater = new CheckBox("Update default sequences");
            clear   = new CheckBox("Clear current profile", false);
            menuSettings.Add("clear", clear);
            defau = new CheckBox("Set current profile to default");
            menuSettings.Add("defaults", defau);
            menuSettings.AddSeparator(10);

            menuSettings.AddGroupLabel("Humanizer");
            humanMin = new Slider("Minimum time after level up to upgrade an ability(miliseconds)", 300, 0, 2000);
            humanMax = new Slider("Maximum time after level up to upgrade an ability(miliseconds)", 500, 0, 2000);
            menuSettings.Add("xhm", humanMin);
            menuSettings.Add("xhmx", humanMax);
            humanMin.OnValueChange += humanMin_OnValueChange;
            humanMax.OnValueChange += humanMax_OnValueChange;
            menuSettings.AddSeparator(10);
            menuSettings.AddGroupLabel("Updater");
            menuSettings.Add("updateSkills", updater);
            updater.CurrentValue    = false;
            locked[0]               = false;
            updater.OnValueChange  += updater_OnValueChange;
            clear.CurrentValue      = false;
            clear.OnValueChange    += clear_OnValueChange;
            defau.CurrentValue      = false;
            defau.OnValueChange    += defau_OnValueChange;
            profile1.OnValueChange += profile1_OnValueChange;
            profile2.OnValueChange += profile2_OnValueChange;

            profile = profile1.CurrentValue ? 1 : 2;
            lvlFile = Path.Combine(dir + "\\" + "Skills-" + champ.ChampionName + "-" + Game.MapId + "-P" + profile + ".txt");

            this.champ = champ;
            def        = new DefautSequences(dir + "\\" + "Skills-DEFAULT.txt");
            maxLvl     = maxlvl;
            Menu menu = m.AddSubMenu("Skill sequence: " + champ.ChampionName);

            sliders = new LvlSlider[maxlvl];
            skills  = new SkillToLvl[maxlvl];
            for (int i = 0; i < maxLvl; i++)
            {
                sliders[i] = new LvlSlider(menu, i, this);
            }
            load(seq);
            lvlUp = new SkillLevelUp(skills, enabled)
            {
                maxTime = humanMax.CurrentValue,
                minTime = humanMin.CurrentValue
            };
        }
Example #51
0
 // Use this for initialization
 void Awake()
 {
     _slider = GetComponent <Slider> ();
 }
Example #52
0
    public NoteSubEditor(OrbitLineSubEditor orbitLineSubEditor, Note note)
    {
        this.orbitLineSubEditor = orbitLineSubEditor;
        this.note = note;

        VisualTreeAsset visualTree = AssetDatabase.LoadAssetAtPath <VisualTreeAsset>("Assets/Examples/StarSystemScene/Scripts/Editor/StarSystemEditor/NoteSubEditor.uxml");

        visualTree.CloneTree(this);

        StyleSheet stylesheet = AssetDatabase.LoadAssetAtPath <StyleSheet>("Assets/Examples/StarSystemScene/Scripts/Editor/StarSystemEditor/NoteSubEditor.uss");

        this.styleSheets.Add(stylesheet);

        this.AddToClassList("noteSubeditor");


        #region Fields
        SliderInt octave = this.Query <SliderInt>("octave").First();
        octave.value = note.octave;
        octave.RegisterCallback <ChangeEvent <int> >(
            e =>
        {
            note.octave = e.newValue;
            EditorUtility.SetDirty(note);
        }
            );

        // Find an object field with the name and set the type
        ObjectField synthPrefab = this.Query <ObjectField>("synthPrefab").First();
        synthPrefab.objectType = typeof(GameObject);
        synthPrefab.value      = note.synth;

        synthPrefab.RegisterCallback <ChangeEvent <Object> >(
            e =>
        {
            note.synth = (GameObject)e.newValue;
            EditorUtility.SetDirty(note);
        }
            );

        Slider velocity = this.Query <Slider>("velocity").First();
        velocity.value = note.velocity;
        velocity.label = "Velocity " + velocity.value.ToString("F3");
        velocity.RegisterCallback <ChangeEvent <float> >(
            e =>
        {
            note.velocity  = e.newValue;
            velocity.label = "Velocity " + e.newValue.ToString("F3");
            EditorUtility.SetDirty(note);
        }
            );

        Slider length = this.Query <Slider>("length").First();
        length.value = note.length;
        length.label = "Length " + length.value.ToString("F3");
        length.RegisterCallback <ChangeEvent <float> >(
            e =>
        {
            note.length  = e.newValue;
            length.label = "Length " + e.newValue.ToString("F3");
            EditorUtility.SetDirty(note);
        }
            );

        Slider size = this.Query <Slider>("size").First();
        size.value = note.size;
        size.label = "Size " + size.value.ToString("F3");
        size.RegisterCallback <ChangeEvent <float> >(
            e =>
        {
            note.size  = e.newValue;
            size.label = "Size " + e.newValue.ToString("F3");
            EditorUtility.SetDirty(note);
        }
            );

        EnumField noteValue = this.Query <EnumField>("noteValue").First();
        noteValue.value = note.note;
        noteValue.RegisterCallback <ChangeEvent <System.Enum> >(
            e =>
        {
            note.note = (NoteValue)e.newValue;
            EditorUtility.SetDirty(note);
        }
            );

        #endregion


        #region Buttons
        Button btnRemoveNote = this.Query <Button>("btnRemove").First();
        btnRemoveNote.clickable.clicked += RemoveNote;
        #endregion
    }
Example #53
0
 public void Start()
 {
     q = qSlider.GetComponent <Slider>();
 }
Example #54
0
 void UpdateText(Slider slider)
 {
     slider.transform.parent.Find("Value").GetComponent <Text>().text = slider.value.ToString();
 }
Example #55
0
 protected override void Awake()
 {
     base.Awake();
     _slider = GetComponent <Slider> ();
     _slider.onValueChanged.AddListener(OnSliderValueChanged);
 }
Example #56
0
 public EvSlider()
 {
     this.InitializeComponent();
     Slider.AddHandler(PointerReleasedEvent, new PointerEventHandler(Slider_PointerReleased), true);
 }
 public static Slider WithValue(this Slider slider, double value)
 {
     slider.Value = value;
     return(slider);
 }
        private void seiteAufbauen()
        {
            AbsoluteLayout layout = new AbsoluteLayout()
            {
                BackgroundColor = Color.LightGray
            };

            ColorToDouble converter = new ColorToDouble {
                Momentan = Color.Black
            };

            BoxView box = new BoxView {
                BackgroundColor = Color.Black
            };

            Label labelRot  = new Label();
            Label labelGrün = new Label();
            Label labelBlau = new Label();

            Slider sliderRot = new Slider {
                Minimum = 0, Maximum = 1
            };
            Slider sliderGrün = new Slider {
                Minimum = 0, Maximum = 1
            };
            Slider sliderBlau = new Slider {
                Minimum = 0, Maximum = 1
            };

            // Die Value Werte der Sliders werden mit dem Value Property des entsprechenden Sliders verknüpft.
            // Dabei wird noch ein Converter übergeben, der noch ein Parameter bekommt für die Zuweisung des RGB Wertes
            Binding bindingRotSlider = new Binding("BackgroundColor", source: box)
            {
                Converter = converter, ConverterParameter = "Rot"
            };

            sliderRot.SetBinding(Slider.ValueProperty, bindingRotSlider);

            Binding bindingGrünSlider = new Binding("BackgroundColor", source: box)
            {
                Converter = converter, ConverterParameter = "Grün"
            };

            sliderGrün.SetBinding(Slider.ValueProperty, bindingGrünSlider);

            Binding bindingBlauSlider = new Binding("BackgroundColor", source: box)
            {
                Converter = converter, ConverterParameter = "Blau"
            };

            sliderBlau.SetBinding(Slider.ValueProperty, bindingBlauSlider);

            // Die Text Value der Labels werden mit der Background Property der BoxView verknüpft.
            // Dazwischen ist ein Converter, der die Zahlen zu einem richtigen RGB Wert verwandelt und anschließend mit einem StringFormat ausgegeben wird
            Binding bindingRotLabel = new Binding("Value", source: sliderRot)
            {
                Converter = new DoubletoRGBValue(), StringFormat = "R : {0:d}"
            };

            labelRot.SetBinding(Label.TextProperty, bindingRotLabel);

            Binding bindingGrünLabel = new Binding("Value", source: sliderGrün)
            {
                Converter = new DoubletoRGBValue(), StringFormat = "G : {0:d}"
            };

            labelGrün.SetBinding(Label.TextProperty, bindingGrünLabel);

            Binding bindingBlauLabel = new Binding("Value", source: sliderBlau)
            {
                Converter = new DoubletoRGBValue(), StringFormat = "B : {0:d}"
            };

            labelBlau.SetBinding(Label.TextProperty, bindingBlauLabel);

            AbsoluteLayout.SetLayoutBounds(box, new Rectangle(0.3, 0.1, 0.8, 0.2));
            AbsoluteLayout.SetLayoutFlags(box, AbsoluteLayoutFlags.All);

            AbsoluteLayout.SetLayoutBounds(labelRot, new Rectangle(0.1, 0.4, 0.1, 0.1));
            AbsoluteLayout.SetLayoutFlags(labelRot, AbsoluteLayoutFlags.All);

            AbsoluteLayout.SetLayoutBounds(labelGrün, new Rectangle(0.1, 0.6, 0.1, 0.1));
            AbsoluteLayout.SetLayoutFlags(labelGrün, AbsoluteLayoutFlags.All);

            AbsoluteLayout.SetLayoutBounds(labelBlau, new Rectangle(0.1, 0.8, 0.1, 0.1));
            AbsoluteLayout.SetLayoutFlags(labelBlau, AbsoluteLayoutFlags.All);

            AbsoluteLayout.SetLayoutBounds(sliderRot, new Rectangle(0.4, 0.4, 0.5, 0.1));
            AbsoluteLayout.SetLayoutFlags(sliderRot, AbsoluteLayoutFlags.All);

            AbsoluteLayout.SetLayoutBounds(sliderGrün, new Rectangle(0.4, 0.6, 0.5, 0.1));
            AbsoluteLayout.SetLayoutFlags(sliderGrün, AbsoluteLayoutFlags.All);

            AbsoluteLayout.SetLayoutBounds(sliderBlau, new Rectangle(0.4, 0.8, 0.5, 0.1));
            AbsoluteLayout.SetLayoutFlags(sliderBlau, AbsoluteLayoutFlags.All);

            layout.Children.Add(box);
            layout.Children.Add(labelRot);
            layout.Children.Add(labelGrün);
            layout.Children.Add(labelBlau);
            layout.Children.Add(sliderRot);
            layout.Children.Add(sliderGrün);
            layout.Children.Add(sliderBlau);

            Content = layout;
        }
 public static Slider ThumbColor(this Slider slider, Xamarin.Forms.Color color)
 {
     slider.ThumbColor = color;
     return(slider);
 }
Example #60
0
 void Start()
 {
     // スライダーを取得する
     _slider = GameObject.Find("Slider").GetComponent <Slider>();
 }