本文整理汇总了C#中Energy类的典型用法代码示例。如果您正苦于以下问题:C# Energy类的具体用法?C# Energy怎么用?C# Energy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Energy类属于命名空间,在下文中一共展示了Energy类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start()
{
currentScore = GameObject.Find("CurrentScore").GetComponent<CurrentScore>();
fullScore = GameObject.FindObjectOfType<FullScore>();
score = GetComponent<Score>();
energy = GetComponent<Energy>();
energyLine = GameObject.FindObjectOfType<EnergyLine>();
inputController = GameObject.FindObjectOfType<InputController>();
timerScript = GameObject.FindObjectOfType<TimerScript>();
timerUI = GameObject.FindObjectOfType<TimerUI>();
info = GetComponent<Info>();
taskStrings = GetComponent<TaskStrings>();
pauseButton = GameObject.FindObjectOfType<PauseButton>().gameObject;
pauseMenu = GameObject.Find("Canvas").GetComponentInChildren<PauseMenu>();
// endMenu = GameObject.FindObjectOfType<EndMenu>();
taskHelper = GameObject.FindObjectOfType<TaskHelper>();
globalController = GetComponent<GlobalController>();
cam = GameObject.Find("MainCamera");
secondCamera = GameObject.Find("SecondCamera");
wordRideCanvas = GameObject.FindObjectOfType<WordRideCanvas>();
metalSparksPrefab = Resources.Load("Prefabs/Particles/MetalSpark") as GameObject;
carUserParametres = GetComponent<CarUserParametres>();
gameUI = GameObject.FindObjectOfType<GameUI>();
canvasController = GameObject.FindObjectOfType<CanvasController>();
particleCanvas = GameObject.Find("ParticleCanvas");
carCreator = GameObject.FindObjectOfType<CarCreator>();
mainBonus = GameObject.FindObjectOfType<MainBonus>();
waitBackground = GameObject.FindObjectOfType<WaitBackground>();
}
示例2: 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);
}
示例3: Energy
void Regulus.Game.IStage.Enter()
{
for (int i = 0; i < _Groups.Length; ++i )
{
var energy = new Energy(3);
var eg = new EnergyGroup() { Energy = energy, Round = Regulus.Utility.Random.Next(0, 3) } ;
Func<bool>[] incs1 =
{
energy.IncGreen , energy.IncRed , energy.IncYellow
};
incs1[Regulus.Utility.Random.Next(0, incs1.Length)]();
incs1[Regulus.Utility.Random.Next(0, incs1.Length)]();
Func<bool>[] incs2 =
{
energy.IncPower , ()=>{eg.Hp = 1; return true;} , ()=>{eg.Change = 1; return true;}
};
incs2[Regulus.Utility.Random.Next(0, incs2.Length)]();
_Groups[i] = eg ;
}
foreach (var capture in _Capturers)
{
capture.Player.OnSpawnCaptureEnergy(capture);
capture.Initial(_Groups);
capture.CaptureEvent += _OnCapture;
}
_Timeout = new Utility.TimeCounter();
}
示例4: Start
public IEnumerator Start()
{
while (Application.isPlaying)
{
if (_Living == 1)
{
// Energy Create
if (_Energy == null)
{
GameObject obj = GameObject.CreatePrimitive(PrimitiveType.Sphere);
_Energy = obj.AddComponent<Energy>();
_Energy.Transform.position = Transform.position;
}
// Energy Available
if (_Energy != null)
_Energy.enabled = true;
yield return new WaitForSeconds(Random.Range(_MinLife, _MaxLife));
// Energy UnAvailable
if (_Energy != null)
_Energy.enabled = false;
yield return new WaitForSeconds(Random.Range(_MinWait, _MaxWait));
}
else
{
if (_Energy != null)
_Energy.enabled = false;
yield return new WaitForSeconds(Random.Range(_MinWait, _MaxWait));
}
}
}
示例5: OpAddition
public void OpAddition()
{
var energy1 = new Energy(2000, EnergyUnit.NewtonMeters);
var energy2 = new Energy(2, EnergyUnit.Kilojoules);
var expected = new Energy(4000, EnergyUnit.NewtonMeters);
(energy1 + energy2).ShouldEqual(expected);
(energy2 + energy1).ShouldEqual(expected);
}
示例6: Launch
public static void Launch(Transform transform1, Energy energy)
{
var instance = GameObject.FindObjectOfType<PopupEnergyLauncher>();
if (instance != null)
{
instance._Launch(transform1 , energy);
}
}
示例7: Start
void Start()
{
desiredDirection = Quaternion.identity;
walking = gameObject.GetComponent<Walking> ();
rotating = gameObject.GetComponent<Rotating> ();
shooting = gameObject.GetComponent<Shooting> ();
swinging = gameObject.GetComponent<Swinging> ();
energy = gameObject.GetComponent<Energy> ();
}
示例8: OpInverseEquals
public void OpInverseEquals()
{
var energy1 = new Energy(2000, EnergyUnit.NewtonMeters);
var energy2 = new Energy(2, EnergyUnit.Kilojoules);
var energy3 = new Energy(4000, EnergyUnit.Joules);
(energy1 != energy2).ShouldBeFalse();
(energy2 != energy1).ShouldBeFalse();
(energy1 != energy3).ShouldBeTrue();
(energy3 != energy1).ShouldBeTrue();
}
示例9: OpGreaterThanOrEqual
public void OpGreaterThanOrEqual()
{
var energy1 = new Energy(2000, EnergyUnit.NewtonMeters);
var energy2 = new Energy(2, EnergyUnit.Kilojoules);
var energy3 = new Energy(4000, EnergyUnit.Joules);
(energy1 >= energy3).ShouldBeFalse();
(energy3 >= energy1).ShouldBeTrue();
(energy1 >= energy2).ShouldBeTrue();
(energy2 >= energy1).ShouldBeTrue();
}
示例10: OpDivision
public void OpDivision()
{
var energy1 = new Energy(2000, EnergyUnit.NewtonMeters);
var energy2 = new Energy(2, EnergyUnit.Kilojoules);
(energy1 / energy2).ShouldBeWithinEpsilonOf(1);
(energy2 / energy1).ShouldBeWithinEpsilonOf(1);
(energy1 / 2).ShouldEqual(new Energy(1000, EnergyUnit.NewtonMeters));
(energy2 / 2).ShouldEqual(new Energy(1, EnergyUnit.Kilojoules));
}
示例11: _Launch
private void _Launch(Transform transform1, Energy energy)
{
var screen = Camera.main.WorldToScreenPoint(transform1.position);
GameObject prefab = _GetPrefab(energy.Type);
var popup = GameObject.Instantiate(prefab);
var rect = popup.GetComponent<RectTransform>();
rect.position = screen;
rect.SetParent(Root);
var text = popup.GetComponentInChildren<UnityEngine.UI.Text>();
text.text = energy.Value.ToString();
}
示例12: Account
/// <summary>
/// Initializes a new instance of the <see cref="Core.Models.Account"/> class.
/// </summary>
/// <param name="id">Account Identifier.</param>
public Account(int id)
: base()
{
ID = id;
UserName = "???";
TerritoryBuildings = new Dictionary<PositionI, long>();
Buildings = new Dictionary<PositionI, long>();
Units = new LinkedList<PositionI>();
BuildableBuildings = new Dictionary<long, List<long>>();
Scrap = new Scrap();
Population = new Population();
Technology = new Technology();
Energy = new Energy();
Plutonium = new Plutonium();
}
示例13: OpEquals
public void OpEquals()
{
var energy1 = new Energy(2000, EnergyUnit.NewtonMeters);
var energy2 = new Energy(2, EnergyUnit.Kilojoules);
var energy3 = new Energy(4000, EnergyUnit.Joules);
(energy1 == energy2).ShouldBeTrue();
(energy2 == energy1).ShouldBeTrue();
(energy1 == energy3).ShouldBeFalse();
(energy3 == energy1).ShouldBeFalse();
energy1.Equals(energy2)
.ShouldBeTrue();
energy1.Equals((object)energy2)
.ShouldBeTrue();
energy2.Equals(energy1)
.ShouldBeTrue();
energy2.Equals((object)energy1)
.ShouldBeTrue();
}
示例14: ToTonsOfCoalTest
public void ToTonsOfCoalTest()
{
Energy target = new Energy(10F);
double expected = 0.00000000034120842375356565;
double actual;
actual = target.ToTonsOfCoal();
Assert.AreEqual(expected, actual);
}
示例15: EnergyConstructorTest
public void EnergyConstructorTest()
{
List<Double> values = new List<Double>();
//Initialization
values.Add(0);
foreach (Double value in values)
{
Energy target = new Energy(value);
Assert.IsInstanceOfType(target, typeof(Energy));
Assert.IsNotNull(target);
}
values.Clear();
}