예제 #1
0
 // Use this for initialization
 void Start()
 {
     provider     = FindObjectOfType <LeapProvider>() as LeapProvider;
     newFluids    = FindObjectOfType <Fluids>() as Fluids;
     position     = new Vector3(0, 0, 0);
     isClosedFist = false;
 }
예제 #2
0
    public override string HeadLossEq(string param, float flowRate)
    {
        // H=8fLQ^2/(pi^2 * D^5 * g)
        var velocity = 4 * flowRate / (Mathf.PI * InnerDiameter * InnerDiameter);
        var rN       = Fluids.Reynolds(Fluids.Density, velocity, InnerDiameter, Fluids.Viscosity);
        var f        = Fluids.FrictionFactor(rN, Roughness);

        return((8 * f * Length / (Mathf.PI * Mathf.PI * 9.81 * Mathf.Pow(InnerDiameter, 5))).ToString("F5") + "*" + param + "^2");
    }
예제 #3
0
        protected override void OnQueryChanged(string oldValue, string newValue)
        {
            base.OnQueryChanged(oldValue, newValue);

            if (string.IsNullOrWhiteSpace(newValue))
            {
                ItemsSource = null;
            }
            else
            {
                ItemsSource = Fluids
                              .Where(fluid => fluid.Name.ToLower().Contains(newValue.ToLower()))
                              .ToList <Fluids>();
            }
        }
예제 #4
0
 public List <Fluid> GetActiveFluids(Vector2 sprite)
 {
     return(Fluids.FindAll(s => s.IsInRange(parameters.hitboxArea, sprite)).ToList());
 }
예제 #5
0
 public void AddFluid(Fluid block) => Fluids.Add(block);
예제 #6
0
 public void RemoveFluid(Fluid fluid)
 {
     Fluids.Remove(fluid);
     drawer.remove(fluid);
 }