Esempio n. 1
0
 //Make existing panels require 0 power on load
 void ChangePower(int amt)
 {
     foreach (var Neon in BaseNetworkable.serverEntities.OfType <NeonSign>()) // BaseNetworkable.serverEntities.OfType is 5x faster than UnityEngine.Object.FindObjectsOfType, thanks for the tip Death!
     {
         Neon.UpdateHasPower(amt, 1);
         Neon.SendNetworkUpdateImmediate();
     }
 }
Esempio n. 2
0
 public override void OnInspectorGUI()
 {
     base.OnInspectorGUI();
     if (GUILayout.Button("Update"))
     {
         Neon neon = (Neon)target;
         neon.UpdateLineRenderers();
     }
     if (GUILayout.Button("Flash"))
     {
         Neon neon = (Neon)target;
         neon.Flash();
     }
 }
Esempio n. 3
0
        public void TestPrintElectronShellCfg_All()
        {
            IElement testSubject;;

            testSubject = new Hydrogen();
            Console.WriteLine($"Hydrogen {testSubject.PrintElectronShellCfg()}");
            testSubject = new Helium();
            Console.WriteLine($"Helium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Lithium();
            Console.WriteLine($"Lithium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Beryllium();
            Console.WriteLine($"Beryllium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Boron();
            Console.WriteLine($"Boron {testSubject.PrintElectronShellCfg()}");
            testSubject = new Carbon();
            Console.WriteLine($"Carbon {testSubject.PrintElectronShellCfg()}");
            testSubject = new Nitrogen();
            Console.WriteLine($"Nitrogen {testSubject.PrintElectronShellCfg()}");
            testSubject = new Oxygen();
            Console.WriteLine($"Oxygen {testSubject.PrintElectronShellCfg()}");
            testSubject = new Fluorine();
            Console.WriteLine($"Fluorine {testSubject.PrintElectronShellCfg()}");
            testSubject = new Neon();
            Console.WriteLine($"Neon {testSubject.PrintElectronShellCfg()}");
            testSubject = new Sodium();
            Console.WriteLine($"Sodium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Magnesium();
            Console.WriteLine($"Magnesium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Aluminum();
            Console.WriteLine($"Aluminum {testSubject.PrintElectronShellCfg()}");
            testSubject = new Silicon();
            Console.WriteLine($"Silicon {testSubject.PrintElectronShellCfg()}");
            testSubject = new Phosphorus();
            Console.WriteLine($"Phosphorus {testSubject.PrintElectronShellCfg()}");
            testSubject = new Sulfur();
            Console.WriteLine($"Sulfur {testSubject.PrintElectronShellCfg()}");
            testSubject = new Chlorine();
            Console.WriteLine($"Chlorine {testSubject.PrintElectronShellCfg()}");
            testSubject = new Argon();
            Console.WriteLine($"Argon {testSubject.PrintElectronShellCfg()}");
            testSubject = new Potassium();
            Console.WriteLine($"Potassium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Calcium();
            Console.WriteLine($"Calcium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Scandium();
            Console.WriteLine($"Scandium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Titanium();
            Console.WriteLine($"Titanium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Vanadium();
            Console.WriteLine($"Vanadium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Chromium();
            Console.WriteLine($"Chromium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Manganese();
            Console.WriteLine($"Manganese {testSubject.PrintElectronShellCfg()}");
            testSubject = new Iron();
            Console.WriteLine($"Iron {testSubject.PrintElectronShellCfg()}");
            testSubject = new Cobalt();
            Console.WriteLine($"Cobalt {testSubject.PrintElectronShellCfg()}");
            testSubject = new Nickel();
            Console.WriteLine($"Nickel {testSubject.PrintElectronShellCfg()}");
            testSubject = new Copper();
            Console.WriteLine($"Copper {testSubject.PrintElectronShellCfg()}");
            testSubject = new Zinc();
            Console.WriteLine($"Zinc {testSubject.PrintElectronShellCfg()}");
            testSubject = new Gallium();
            Console.WriteLine($"Gallium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Germanium();
            Console.WriteLine($"Germanium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Arsenic();
            Console.WriteLine($"Arsenic {testSubject.PrintElectronShellCfg()}");
            testSubject = new Selenium();
            Console.WriteLine($"Selenium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Bromine();
            Console.WriteLine($"Bromine {testSubject.PrintElectronShellCfg()}");
            testSubject = new Krypton();
            Console.WriteLine($"Krypton {testSubject.PrintElectronShellCfg()}");
            testSubject = new Rubidium();
            Console.WriteLine($"Rubidium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Strontium();
            Console.WriteLine($"Strontium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Yttrium();
            Console.WriteLine($"Yttrium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Zirconium();
            Console.WriteLine($"Zirconium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Niobium();
            Console.WriteLine($"Niobium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Molybdenum();
            Console.WriteLine($"Molybdenum {testSubject.PrintElectronShellCfg()}");
            testSubject = new Technetium();
            Console.WriteLine($"Technetium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Ruthenium();
            Console.WriteLine($"Ruthenium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Rhodium();
            Console.WriteLine($"Rhodium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Palladium();
            Console.WriteLine($"Palladium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Silver();
            Console.WriteLine($"Silver {testSubject.PrintElectronShellCfg()}");
            testSubject = new Cadmium();
            Console.WriteLine($"Cadmium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Indium();
            Console.WriteLine($"Indium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Tin();
            Console.WriteLine($"Tin {testSubject.PrintElectronShellCfg()}");
            testSubject = new Antimony();
            Console.WriteLine($"Antimony {testSubject.PrintElectronShellCfg()}");
            testSubject = new Tellurium();
            Console.WriteLine($"Tellurium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Iodine();
            Console.WriteLine($"Iodine {testSubject.PrintElectronShellCfg()}");
            testSubject = new Xenon();
            Console.WriteLine($"Xenon {testSubject.PrintElectronShellCfg()}");
            testSubject = new Cesium();
            Console.WriteLine($"Cesium {testSubject.PrintElectronShellCfg()}");
            testSubject = new Barium();
            Console.WriteLine($"Barium {testSubject.PrintElectronShellCfg()}");
        }
Esempio n. 4
0
    public void Update()
    {
        // Cases
        switch (ShopStats.gas)
        {
        case 1:
            gas = 200;
            break;

        case 2:
            gas = 300;
            break;

        case 3:
            gas = 500;
            break;

        case 5:
            gas = 700;
            break;

        case 6:
            gas = 1000;
            break;

        default:
            gas = 60;
            break;
        }
        switch (ShopStats.velocity)
        {
        case 1:
            speed = 20;
            life  = 20;
            break;

        case 2:
            speed = 30;
            life  = 30;
            break;

        case 3:
            speed = 40;
            life  = 50;
            break;

        case 4:
            speed   = 50;
            nitroOk = true;
            nNitros = 1;
            life    = 100;
            Archievements.NitroIsEnable = true;
            break;

        case 5:
            speed   = 60;
            nitroOk = true;
            nNitros = 3;
            life    = 200;
            Archievements.NitroIsEnable = true;
            break;

        default:
            speed = 10;
            life  = 10;
            break;
        }
        switch (ShopStats.mass)
        {
        default:
            rb.mass = 850;
            break;

        case 1:
            rb.mass = 950;
            break;

        case 2:
            rb.mass = 1050;
            break;

        case 3:
            rb.mass = 1150;
            break;

        case 4:
            rb.mass = 1550;
            break;

        case 5:
            rb.mass = 2550;
            break;
        }
        // Fim do Switch

        Wheel    = wheelAngle / maximumSteeringAngle;
        Whelllow = Wheel;
        //motor = maxMotorTorque * Input.GetAxis("Vertical");
        motor = maxMotorTorque * speed * Time.deltaTime;

        float steering    = maxSteeringAngle * Wheel;
        float brakeTorque = Mathf.Abs(Whelllow);

        if (brakeTorque > 0.90)
        {
            brakeTorque = maxMotorTorque;
            motor--;
            //Desacelera o carro conforme a curva
        }
        else
        {
            brakeTorque = 0;
        }

        foreach (Dot_Truck truck_Info in truck_Infos)
        {
            if (truck_Info.steering == true)
            {
                truck_Info.leftWheel.steerAngle = truck_Info.rightWheel.steerAngle = ((truck_Info.reverseTurn) ? -1 : 1) * steering;
            }

            if (truck_Info.motor == true)
            {
                truck_Info.leftWheel.motorTorque  = motor;
                truck_Info.rightWheel.motorTorque = motor;
            }

            truck_Info.leftWheel.brakeTorque  = brakeTorque;
            truck_Info.rightWheel.brakeTorque = brakeTorque;

            VisualizeWheel(truck_Info);
        }

        EngineSound();
        //Debug.Log("brakeTorque" + brakeTorque);
        //Debug.Log("maxMotorTorque" + maxMotorTorque);
        //Debug.Log("motor" + motor);

        //Quando o volante é solto, ele reseta a rotação.
        if (!wheelBeingHeld && !Mathf.Approximately(0f, wheelAngle))
        {
            float deltaAngle = wheelReleasedSpeed * Time.deltaTime;
            if (Mathf.Abs(deltaAngle) > Mathf.Abs(wheelAngle))
            {
                wheelAngle = 0f;
            }
            else if (wheelAngle > 0f)
            {
                wheelAngle -= deltaAngle;
            }
            else
            {
                wheelAngle += deltaAngle;
            }
        }
        // Roda a imagem
        rectT.localEulerAngles = Vector3.back * 2 * wheelAngle;
        // Neon
        if (neon == true)
        {
            Neon.SetActive(true);
        }
        else
        {
            Neon.SetActive(false);
        }
        if (gas <= 0)
        {
            maxMotorTorque = 0;
        }
        //lifeBar.GetComponent<RectTransform>().offsetMax = new Vector2(life, -10f);
    }
Esempio n. 5
0
 /// <summary>
 /// Возвращает rgb-цвет неона
 /// </summary>
 public byte[] GetNeonColor()
 {
     return(string.IsNullOrEmpty(Neon)
         ? new byte[0]
         : Neon.Split(';').Select(e => Convert.ToByte(e)).ToArray());
 }