private static void DoLookToActionParameters(Rect rect, GeoActionDataControl action) { var horiz = rect.Divide(2); var vert = horiz[0].Divide(1, 2); EditorGUI.BeginChangeCheck(); var newInside = GUI.Toggle(vert[0, 0], (bool)action["Inside"], "Geo.GeoElementWindow.Actions.Parameter.Inside".Traslate()); if (EditorGUI.EndChangeCheck()) { action["Inside"] = newInside; } EditorGUI.BeginChangeCheck(); var newCenter = GUI.Toggle(vert[1, 0], (bool)action["Center"], "Geo.GeoElementWindow.Actions.Parameter.Center".Traslate()); if (EditorGUI.EndChangeCheck()) { action["Center"] = newCenter; } if (newCenter) { EditorGUI.BeginChangeCheck(); var newDirection = RadialSlider.Do(horiz[1], "Geo.GeoElementWindow.Actions.Parameter.Direction".Traslate(), (Vector2)action["Direction"]); if (EditorGUI.EndChangeCheck()) { action["Direction"] = newDirection; } } }
public override void Initialize() { m_Content = FindComponent <Animator>("Content"); m_AltitudeRule = FindComponent <RadialSlider>("Content/Ruler"); m_AltitudeArrow = FindComponent <RadialSlider>("Content/Arrow"); m_Content.gameObject.SetActive(false); }
void Awake() { if (sliderObj) { radialSlider = sliderObj.GetComponent <RadialSlider>(); } if (radialSlider) { radialSlider.ValueChangedCallback += OnValueChanged; } }
public PerformancePage() { InitializeComponent(); for (int i = 0; i < 40; i++) { RadialSlider slider = new RadialSlider(); slider.Width = 90; slider.Height = 90; slider.ShowSliderValue = true; slider.MinimumValue = 0; slider.MaximumValue = 360; slider.CurrentValue = i * 9; slider.AllowKeyboardInput = false; wrapPanel.Children.Add(slider); } }
void Awake() { if (GameObject.FindGameObjectWithTag("myRadialSlider")) { mainSlider = (RadialSlider)GameObject.FindObjectOfType(typeof(RadialSlider)); } if (GameObject.FindGameObjectWithTag("cat")) { cat = (GameObject)FindObjectOfType(typeof(GameObject)); } //initialize the position of the sun if (count == 0) { StopTime = 0; } StopTime = mainSlider.Value * numHours; TimeOfDay = mainSlider.Value * numHours; count = count + 1; }
/// <summary> /// 更新武器的子弹信息 /// </summary> private void UpdateWeaponBullets() { if (m_Crosshair != null && m_WeaponStyle != WeaponAndCrossSight.WeaponAndCrossSightTypes.Null) { Transform powerSlider = FindComponent<Transform>(m_Crosshair, "Slider"); Animator powerSliderAnimator = FindComponent<Animator>(m_Crosshair, "Slider"); if (powerSlider == null) return; PlayerSkillProxy skillProxy = Facade.RetrieveProxy(ProxyName.PlayerSkillProxy) as PlayerSkillProxy; if (skillProxy.UsingReformer()) { powerSlider.gameObject.SetActive(false); return; } IWeapon currentWeapon = skillProxy.GetCurrentWeapon(); if (currentWeapon == null) { powerSlider.gameObject.SetActive(false); return; } WeaponPowerVO weaponVO1 = skillProxy.GetWeaponPowerOfMainPlayer(0); WeaponPowerVO weaponVO2 = skillProxy.GetWeaponPowerOfMainPlayer(1); WeaponPowerVO power = weaponVO1 != null && skillProxy.GetWeaponByUID(weaponVO1.WeaponUID) == currentWeapon ? weaponVO1 : weaponVO2; float curr = 0; float total = 0; if (power != null) { if (m_WeaponStyle == WeaponAndCrossSight.WeaponAndCrossSightTypes.MachineGun ) { curr = power.CurrentValue; total = power.MaxValue; } else if (m_WeaponStyle == WeaponAndCrossSight.WeaponAndCrossSightTypes.Missile) { foreach (var entity in m_CurrentTargetList.Values) { curr += entity.LockTimes; } total = MaxMissileCount;// skillProxy.GetCurrentBattleWeapon().GetRelativeHeightOfReticle().MissileCountInOneShot; } else if ((int)m_WeaponStyle ==(int)WeaponAndCrossSight.WeaponAndCrossSightTypes.ShotGun) { curr = power.CurrentValue; total = power.MaxValue; } } float weaponPowerRatio = total != 0 ? curr / total : 0; if (powerSliderAnimator) { if (power.ForceCooldown) powerSliderAnimator.SetInteger("State", 2); else if (weaponPowerRatio <= 0.7f) powerSliderAnimator.SetInteger("State", 0); else if (weaponPowerRatio > 0.7f) powerSliderAnimator.SetInteger("State", 1); if (m_lastFireFail) powerSliderAnimator.SetTrigger("FireFail"); } m_lastFireFail = false; RadialSlider radialSlider = powerSlider.GetComponent<RadialSlider>(); if(radialSlider) { radialSlider.FillAmount = weaponPowerRatio; return; } BulletSlider bulletSlider = powerSlider.GetComponent<BulletSlider>(); if(bulletSlider) { bulletSlider.BulletCount = (int)total; bulletSlider.FillAmount = weaponPowerRatio; return; } Slider commonSlider = powerSlider.GetComponent<Slider>(); if(commonSlider) { commonSlider.minValue = 0; commonSlider.maxValue = 1; commonSlider.value = weaponPowerRatio; return; } } }