• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Volume类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Volume的典型用法代码示例。如果您正苦于以下问题:C# Volume类的具体用法?C# Volume怎么用?C# Volume使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Volume类属于命名空间,在下文中一共展示了Volume类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BlocksInVolume

 /// <summary>Iterates over all the blocks contained in a volume.</summary>
 public static void BlocksInVolume(Volume volume, Action<CoordinateInt> action)
 {
     for (int x = 0; x < volume.ScaleX; x++)
         for (int y = 0; y < volume.ScaleY; y++)
             for (int z = 0; z < volume.ScaleZ; z++)
                 action(volume.Coord.Offset(x, y, z));
 }
开发者ID:xFleury,项目名称:NbtToObj,代码行数:8,代码来源:Iterators.cs


示例2: analyzeAudio

        public void analyzeAudio(byte[] audioBuffer, float[] energy)
        {
            this.audioBuffer = audioBuffer;
            this.energy = energy;
            this.averageVolume = 0;

            calcAverageVolume();
            calcIsSpeaking();
            if(isSpeaking)
            {
                TimeSpan speaking = new TimeSpan(startedSpeaking.Ticks);
                TimeSpan now = new TimeSpan(DateTime.Now.Ticks);
                if (now.TotalMilliseconds - speaking.TotalMilliseconds > ThresholdActuallySpeaking)
                {
                    assignSpeakingVolume();
                    calcSpeakingTime();
                }
                else
                {
                    voiceVolume = Volume.good;
                    calcPausingTime();
                }
            }
            else
            {
                voiceVolume = Volume.good;
                calcPausingTime();
            }

        }
开发者ID:Jonathan1,项目名称:MasterThesis-PresentationTrainer,代码行数:30,代码来源:AudioPreAnalysis.cs


示例3: AdjustVolume

 public void AdjustVolume(Volume volume)
 {
     switch (volume)
     {
         case Volume.low:
             MasterVolume = volume;
             break;
         case Volume.medium:
             MasterVolume = volume;
             break;
         case Volume.medium_high:
             MasterVolume = volume;
             break;
         case Volume.high:
             MasterVolume = volume;
             break;
         case Volume.mute:
             masterVolume = 0f;
             MasterVolume = volume;
             break;
         default:
             AdjustVolume(Volume.medium);
             break;
     }
 }
开发者ID:dajuanrobins,项目名称:XNA-Game-Library,代码行数:25,代码来源:AudioManager.cs


示例4: VerifyAllEnums

 public void VerifyAllEnums()
 {
     var acceleration = new Acceleration(1, AccelerationUnit.BaseUnit);
     var angle = new Angle(1, AngleUnit.BaseUnit);
     var angularAcceleration = new AngularAcceleration(1, AngularAccelerationUnit.BaseUnit);
     var area = new Area(1, AreaUnit.BaseUnit);
     var density = new MassDensity(1, MassDensityUnit.BaseUnit);
     var electricCurrent = new ElectricCurrent(1, ElectricCurrentUnit.BaseUnit);
     var electricResistance = new ElectricResistance(1, ElectricResistanceUnit.BaseUnit);
     var electricVoltage = new ElectricPotential(1, ElectricPotentialUnit.BaseUnit);
     var energy = new Energy(1, EnergyUnit.BaseUnit);
     var force = new Force(1, ForceUnit.BaseUnit);
     var frequency = new Frequency(1, FrequencyUnit.BaseUnit);
     var jerk = new Jerk(1, JerkUnit.BaseUnit);
     var length = new Length(1, LengthUnit.BaseUnit);
     var mass = new Mass(1, MassUnit.BaseUnit);
     var massFlowRate = new MassFlowRate(1, MassFlowRateUnit.BaseUnit);
     var momentum = new Momentum(1, MomentumUnit.BaseUnit);
     var numeric = new Numeric(1, NumericUnit.BaseUnit);
     var power = new Power(1, PowerUnit.BaseUnit);
     var pressure = new Pressure(1, PressureUnit.BaseUnit);
     var speed = new Speed(1, SpeedUnit.BaseUnit);
     var temperature = new Temperature(1, TemperatureUnit.BaseUnit);
     var time = new Time(1, TimeUnit.BaseUnit);
     var torque = new Torque(1, TorqueUnit.BaseUnit);
     var volume = new Volume(1, VolumeUnit.BaseUnit);
     var volumetricFlowRate = new VolumetricFlowRate(1, VolumetricFlowRateUnit.BaseUnit);
 }
开发者ID:EddieGarmon,项目名称:GraduatedCylinder,代码行数:28,代码来源:EnumerationVerification.cs


示例5: detector_Collided

    void detector_Collided(Volume collisonObject, Voxel voxel, Vector3 worldPosition)
    {
        // If the bullet hits an invader and is owned by the player, explode and destroy the invader - and deactivate the bullet
        if (collisonObject.name == "Invader" && Owner is InvadersPlayerShip)
        {
            collisonObject.Destruct(3f, true);
            Destroy(collisonObject.gameObject);
            gameObject.SetActive(false);
        }

        // If we hit a shield, just explode and deactivate the bullet
        if (collisonObject.name == "Shield")
        {
            exploder.ExplosionRadius = 1f;
            exploder.Explode();
            gameObject.SetActive(false);
        }

        // If we hit the player ship
        if (collisonObject.name == "Player Ship")
        {
            collisonObject.Destruct(3f, true);
            collisonObject.GetComponent<InvadersPlayerShip>().Die();
            gameObject.SetActive(false);
        }
    }
开发者ID:arancauchi,项目名称:Mini-Games,代码行数:26,代码来源:InvadersBullet.cs


示例6: GetVolume

        public Volume GetVolume(string ComicVineVolumeRequestXMLResponse)
        {
            var volume = new Volume();
            var xDoc = XDocument.Parse(ComicVineVolumeRequestXMLResponse);
            volume.id = ParseHelper.ParseInt((string)xDoc.Descendants("id").Where(p => p.Parent.Name.LocalName == "results").FirstOrDefault() ?? "0");
            volume.name = (string)xDoc.Descendants("name").Where(p => p.Parent.Name.LocalName == "results").FirstOrDefault() ?? "";
            volume.description = (string)xDoc.Descendants("description").Where(p => p.Parent.Name.LocalName == "results").FirstOrDefault() ?? "";
            volume.dateAdded = ParseHelper.ParseDateTime((string)xDoc.Descendants("date_added").Where(p => p.Parent.Name.LocalName == "results").FirstOrDefault() ?? "");
            volume.dateLastUpdated = ParseHelper.ParseDateTime((string)xDoc.Descendants("date_last_updated").Where(p => p.Parent.Name.LocalName == "results").FirstOrDefault() ?? "");
            volume.countOfIssues = ParseHelper.ParseInt((string)xDoc.Descendants("count_of_issues").Where(p => p.Parent.Name.LocalName == "results").FirstOrDefault() ?? "0");
            volume.startYear = ParseHelper.ParseInt((string)xDoc.Descendants("start_year").Where(p => p.Parent.Name.LocalName == "results").FirstOrDefault() ?? "0");
            volume.publisherId = ParseHelper.ParseInt((string)xDoc.Descendants("id").Where(p => p.Parent.Name.LocalName == "publisher").FirstOrDefault() ?? "0");
            volume.collectable = true;

            if (volume.dateLastUpdated > DateTime.Now.AddMonths(-13))
            {
                volume.complete = false;
            }
            else
            {
                volume.complete = true;
            }

            reprintDetector.DetectReprint(volume);
            return volume;
        }
开发者ID:AtlasFontaine,项目名称:ComicHoarder,代码行数:26,代码来源:ComicVineXMLReader.cs


示例7: VolumeCreate

        public void VolumeCreate()
        {
            Configure();
            volume = new Volume
            {
                Properties = new VolumeProperties
                {
                    Size = 4,
                    Image = imageId,
                    Type = "HDD",
                    Name = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                    SshKeys = new System.Collections.Generic.List<string> { "hQGOEJeFL91EG3+l9TtRbWNjzhDVHeLuL3NWee6bekA=" }
                }
            };
            volume = volumeApi.Create(datacenter.Id, volume);

            bool isBusy = true;

            while (isBusy == true)
            {
                var dc = dcApi.FindById(datacenter.Id);
                if (dc.Metadata.State != "BUSY") isBusy = false;
                Thread.Sleep(1500);
            }

            Assert.IsNotNull(volume);
        }
开发者ID:mechagrue,项目名称:profitbricks-sdk-net,代码行数:27,代码来源:VolumeApiTest.cs


示例8: Power_LengthRaisedWith3_ReturnsVolume

 public void Power_LengthRaisedWith3_ReturnsVolume()
 {
     var expected = new Volume(1.0, Volume.CubicDeciMeter);
     var len = new Measure<Length>(1.0, Length.DeciMeter);
     Volume actual; ArithmeticOperations.Power(len, 3, out actual);
     MeasureAssert.AmountsAreEqual(expected, actual);
 }
开发者ID:bjaminn,项目名称:csunits,代码行数:7,代码来源:ArithmeticOperationsTests.cs


示例9: can_use_mass_volume_constructor

 [Test] public void can_use_mass_volume_constructor() {
     Mass m = new Mass(10, MassUnit.Pounds);
     Volume v = new Volume(2, VolumeUnit.Gallons);
     var d = new Density(m, v);
     d.Mass.ShouldEqual(m);
     d.Volume.ShouldEqual(v);
 }
开发者ID:togakangaroo,项目名称:GIM.Quantities,代码行数:7,代码来源:When_creating_density.cs


示例10: InitAudio

	public void InitAudio()
	{
		gameVolume = GameObject.Find("2DAudio").GetComponent<Volume>();
		
		if (GameObject.Find("musicSlider") != null &&
		    GameObject.Find("soundFXSlider")!= null &&
		    GameObject.Find("dialogueSlider") != null)
		{
			musicSlider = GameObject.Find("musicSlider").GetComponent<UISlider>();
			soundFXSlider = GameObject.Find("soundFXSlider").GetComponent<UISlider>();
			dialogueSlider = GameObject.Find("dialogueSlider").GetComponent<UISlider>();


			if (!PlayerPrefs.HasKey("MusicVol"))
				gameVolume.MusicVolume = musicSlider.value;
			else
				musicSlider.value = PlayerPrefs.GetFloat("MusicVol");
			
			if (!PlayerPrefs.HasKey("SoundFXVol"))
				gameVolume.AmbienceVolume = soundFXSlider.value;
			else
				soundFXSlider.value = PlayerPrefs.GetFloat("SoundFXVol");
			
			if (!PlayerPrefs.HasKey("DialogueVol"))
				gameVolume.AIVolume = dialogueSlider.value;
			else
				dialogueSlider.value = PlayerPrefs.GetFloat("DialogueVol");

		}

	}
开发者ID:henryj41043,项目名称:TheUnseen,代码行数:31,代码来源:Settings.cs


示例11: OpAddition

 public void OpAddition()
 {
     var volume1 = new Volume(3600, VolumeUnit.Liters);
     var volume2 = new Volume(1, VolumeUnit.CubicMeters);
     var expected = new Volume(4600, VolumeUnit.Liters);
     (volume1 + volume2).ShouldEqual(expected);
     (volume2 + volume1).ShouldEqual(expected);
 }
开发者ID:EddieGarmon,项目名称:GraduatedCylinder,代码行数:8,代码来源:VolumeOperators.cs


示例12: detector_Collided

 private void detector_Collided(Volume collisonObject, Voxel voxel, Vector3 worldPosition)
 {
     if (collisonObject.name.StartsWith("Plane") && Owner is ShmupChopper)
     {
         collisonObject.GetComponent<ShmupPlane>().Die();
         gameObject.SetActive(false);
     }
 }
开发者ID:arancauchi,项目名称:Mini-Games,代码行数:8,代码来源:ShmupBullet.cs


示例13: Times_MultiplyAreaAndLength_ReturnsVolume

 public void Times_MultiplyAreaAndLength_ReturnsVolume()
 {
     var expected = new Volume(6.0);
     var lhs = new Area(2.0);
     var rhs = new Length(3.0);
     Volume actual; ArithmeticOperations.Times(lhs, rhs, out actual);
     MeasureAssert.MeasuresAreEqual(expected, actual);
 }
开发者ID:bjaminn,项目名称:csunits,代码行数:8,代码来源:ArithmeticOperationsTests.cs


示例14: Divide_DivideVolumeAndLength_ReturnsArea

 public void Divide_DivideVolumeAndLength_ReturnsArea()
 {
     var expected = new Area(4.0);
     var numerator = new Volume(8.0);
     var denominator = new Length(200.0, Length.CentiMeter);
     Area actual; ArithmeticOperations.Divide(numerator, denominator, out actual);
     MeasureAssert.MeasuresAreEqual(expected, actual);
 }
开发者ID:bjaminn,项目名称:csunits,代码行数:8,代码来源:ArithmeticOperationsTests.cs


示例15: Shape

 public Shape(Point center, Volume volume, Contour contour, ConvexHull convexHull, IList<Point> points)
 {
     this.center = center;
     this.volume = volume;
     this.contour = contour;
     this.convexHull = convexHull;
     this.points = points;
 }
开发者ID:an83,项目名称:KinectTouch2,代码行数:8,代码来源:Shape.cs


示例16: GetVolumeWithRangeCheck

 private Volume GetVolumeWithRangeCheck(Volume volume)
 {
     if (volume.CheckRange(shared.Vessel))
     {
         return volume;
     }
     throw new Exception("Volume is out of range");
 }
开发者ID:Whitecaribou,项目名称:KOS,代码行数:8,代码来源:RemoteTechVolumeManager.cs


示例17: Save

        public bool Save(Volume volume)
        {
            if (VolumeExists(volume.id))
            {
                return Update(volume);
            }

            return Insert(volume);
        }
开发者ID:AtlasFontaine,项目名称:ComicHoarder,代码行数:9,代码来源:MSSQLDatabase.cs


示例18: OpGreaterThanOrEqual

 public void OpGreaterThanOrEqual()
 {
     var volume1 = new Volume(3600, VolumeUnit.Liters);
     var volume2 = new Volume(3.6, VolumeUnit.CubicMeters);
     var volume3 = new Volume(5, VolumeUnit.CubicMeters);
     (volume1 >= volume3).ShouldBeFalse();
     (volume3 >= volume1).ShouldBeTrue();
     (volume1 >= volume2).ShouldBeTrue();
     (volume2 >= volume1).ShouldBeTrue();
 }
开发者ID:EddieGarmon,项目名称:GraduatedCylinder,代码行数:10,代码来源:VolumeOperators.cs


示例19: OpDivision

        public void OpDivision()
        {
            var volume1 = new Volume(3600, VolumeUnit.Liters);
            var volume2 = new Volume(3.6, VolumeUnit.CubicMeters);
            (volume1 / volume2).ShouldBeWithinEpsilonOf(1);
            (volume2 / volume1).ShouldBeWithinEpsilonOf(1);

            (volume1 / 2).ShouldEqual(new Volume(1800, VolumeUnit.Liters));
            (volume2 / 2).ShouldEqual(new Volume(1.8, VolumeUnit.CubicMeters));
        }
开发者ID:EddieGarmon,项目名称:GraduatedCylinder,代码行数:10,代码来源:VolumeOperators.cs


示例20: OpInverseEquals

 public void OpInverseEquals()
 {
     var volume1 = new Volume(3600, VolumeUnit.Liters);
     var volume2 = new Volume(3.6, VolumeUnit.CubicMeters);
     var volume3 = new Volume(5, VolumeUnit.CubicMeters);
     (volume1 != volume2).ShouldBeFalse();
     (volume2 != volume1).ShouldBeFalse();
     (volume1 != volume3).ShouldBeTrue();
     (volume3 != volume1).ShouldBeTrue();
 }
开发者ID:EddieGarmon,项目名称:GraduatedCylinder,代码行数:10,代码来源:VolumeOperators.cs



注:本文中的Volume类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# VolunteerService类代码示例发布时间:2022-05-24
下一篇:
C# VoidDelegate类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap