Ejemplo n.º 1
0
    public void Init(float displacement, int numberOfBanks, int numberOfCylinders)
    {
        Displacement = displacement;

        Crankshaft = new GameObject("Crankshaft").AddComponent <Crankshaft>();
        Crankshaft.transform.parent = transform;
        Crankshaft.Init(displacement, numberOfBanks, numberOfCylinders);
    }
 public Engine()
 {
     Crankshaft = new Crankshaft();
     Pistons    = new Piston[8];
     Pistons[0] = new Piston();
     Pistons[1] = new Piston();
     Pistons[2] = new Piston();
     Pistons[3] = new Piston();
 }
Ejemplo n.º 3
0
        public Engine()
        {
            Crankshaft = new Crankshaft();
            Pistons    = new Piston[8];

            for (int i = 0; i < 4; i++)
            {
                Pistons[i] = new Piston();
            }
        }
Ejemplo n.º 4
0
 public void CrankshaftToevoegen(Crankshaft crankshaft)
 {
     if (this.crankshafts != null)
     {
         if (this.crankshafts.GetLength(0) < maxCrankshaft)
         {
             this.crankshafts[this.crankshafts.GetLength(0) + 1] = crankshaft;
         }
         else
         {
             this.crankshafts[0] = crankshaft;
         }
     }
 }