Inheritance: MonoBehaviour
 // Start is called before the first frame update
 void Start()
 {
     StartCoroutine(Move());
     StartCoroutine(SpeedChange());
     movecar = Object.FindObjectOfType <MoveCar>();
     stopcar = Object.FindObjectOfType <StopCar>();
 }
Exemple #2
0
 private void Awake()
 {
     moveCar              = this.GetComponent <MoveCar> ();
     leftwardRayHitPoint  = GameObject.Find("LeftRay");
     forwardRayHitPoint   = GameObject.Find("CenterRay");
     rightwardRayHitPoint = GameObject.Find("RightRay");
 }
Exemple #3
0
 public void JoinGame(params Car[] cars)                                  // Подписываемся на игру
 {
     foreach (var car in cars)
     {
         Move       += car.Move;
         MoveTo     += car.MoveTo;
         car.Finish += OnFinish;
         Out        += car.Out;
     }
 }
Exemple #4
0
    IEnumerator CreateCar()
    {
        yield return(new WaitForSeconds(timeCreate));

        GameObject car = Instantiate(CarPrefab[Random.Range(0, CarPrefab.Length)]);

        car.transform.position = pointStart.transform.position;
        MoveCar carMove = car.GetComponent <MoveCar>();

        carMove.pointFinish = pointFinish;
        StartCoroutine(CreateCar());
    }
Exemple #5
0
 // Use this for initialization
 void Start()
 {
     control = gameObject.AddComponent<MoveCar>();
     controller = new PController (control);
     if (drawLines) {
         lines = gameObject.AddComponent<LineRenderer> ();
         lines.SetWidth (0.1f, 0.1f);
         lines.material = new Material(Shader.Find("Unlit/Texture"));
         lines.castShadows = false;
         lines.receiveShadows = false;
         lines.SetColors (Color.white, Color.white);
     }
 }
    private void Awake()
    {
        moveCar              = this.GetComponent <MoveCar> ();
        leftwardRayHitPoint  = GameObject.Find("LeftRay");
        forwardRayHitPoint   = GameObject.Find("CenterRay");
        rightwardRayHitPoint = GameObject.Find("RightRay");

        //So that this does not reset every turn
        if (informationList == null)
        {
            informationList = new List <Values> ();
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        //gives keyinputs to every object
        GameObject currentObject1     = GameObject.Find("Player1Car");
        MoveCar    currentObjectMove1 = currentObject1.GetComponent <MoveCar>();

        currentObjectMove1.keyInput = "f";

        GameObject currentObject2     = GameObject.Find("Player2Car");
        MoveCar    currentObjectMove2 = currentObject2.GetComponent <MoveCar>();

        currentObjectMove2.keyInput = "g";

        GameObject currentObject3     = GameObject.Find("Player3Car");
        MoveCar    currentObjectMove3 = currentObject3.GetComponent <MoveCar>();

        currentObjectMove3.keyInput = "h";

        GameObject currentObject4     = GameObject.Find("Player4Car");
        MoveCar    currentObjectMove4 = currentObject4.GetComponent <MoveCar>();

        currentObjectMove4.keyInput = "j";
    }
 private void Awake()
 {
     moveCar = this.GetComponent<MoveCar> ();
 }
Exemple #9
0
 // Use this for initialization
 void Start()
 {
     control = GetComponent<MoveCar>();
 }
 private void Awake()
 {
     moveCar = this.GetComponent<MoveCar> ();
     leftwardRayHitPoint = GameObject.Find ("LeftRay");
     forwardRayHitPoint = GameObject.Find ("CenterRay");
     rightwardRayHitPoint = GameObject.Find ("RightRay");
 }
    // Use this for initialization
    void Start()
    {
        imageChassy1 = GameObject.Find("Chassy Small UI").GetComponent<Image>();
        imageChassy2 = GameObject.Find("Chassy Medium UI").GetComponent<Image>();
        imageChassy3 = GameObject.Find("Chassy Large UI").GetComponent<Image>();
        imageWheels1 = GameObject.Find("Wheel Type 1 UI").GetComponent<Image>();
        imageWheels2 = GameObject.Find("Wheel Type 2 UI").GetComponent<Image>();
        imageTurret1 = GameObject.Find("Turret Mini UI").GetComponent<Image>();
        imageTurret2 = GameObject.Find("Turret Twin UI").GetComponent<Image>();
        imageTurret3 = GameObject.Find("Turret Rail UI").GetComponent<Image>();
        imageTurret4 = GameObject.Find("Turret Bazooka UI").GetComponent<Image>();
        imageAbility1 = GameObject.Find("Ability Dash UI").GetComponent<Image>();
        imageAbility2 = GameObject.Find("Ability Repair UI").GetComponent<Image>();
        imageAbility3 = GameObject.Find("Ability Spring UI").GetComponent<Image>();
        imageAbility4 = GameObject.Find("Ability Shield UI").GetComponent<Image>();

        carHP = GameObject.Find("car").GetComponent<MoveCar>();
        halfMaxHealth = carHP.carHP;
        something = (int)Math.Round(255 / carHP.carHP);
    }
 // Use this for initialization
 void Start()
 {
     ChangeCar();
     mainCamera = GameObject.Find("Main Camera");
     carCamera = GameObject.Find("Car Camera");
     canvasGarage = GameObject.Find("Garage Canvas");
     canvasGame = GameObject.Find("Game Canvas");
     playerObjectNumber = GameObject.Find("Player object numbers");
     gameCrosshair = GameObject.Find("Crosshair");
     eListener = GameObject.Find("EventSystem");
     gunStats = GameObject.Find("car").GetComponent<MoveCar>();
     oldmaterial = carChassy.GetComponent<Renderer>().materials;
 }
 void Awake()
 {
     //StartCoroutine (SendAndReceiveData())
     sensor = this.GetComponent<Sensors> ();
     moveCar = this.GetComponent<MoveCar> ();
 }
Exemple #14
0
 // Use this for initialization
 void Start()
 {
     control = (MoveCar)gameObject.AddComponent ("MoveCar");
 }
    private void Awake()
    {
        moveCar = this.GetComponent<MoveCar> ();
        leftwardRayHitPoint = GameObject.Find ("LeftRay");
        forwardRayHitPoint = GameObject.Find ("CenterRay");
        rightwardRayHitPoint = GameObject.Find ("RightRay");

        //So that this does not reset every turn
        if (informationList == null) {
            informationList = new List<Values> ();
        }
    }
    // Use this for initialization
    void Start()
    {
        carStats = GameObject.Find("car").GetComponent<MoveCar>();

        whatUpgrading = GameObject.Find("What Upgrading").GetComponent<Text>();
        upPoints = GameObject.Find("Upgrade Points").GetComponent<Text>();
        upgrade1 = GameObject.Find("Upgrade Circle 1").GetComponent<Image>();
        upgrade2 = GameObject.Find("Upgrade Circle 2").GetComponent<Image>();
        upgrade3 = GameObject.Find("Upgrade Circle 3").GetComponent<Image>();
        upgrade4 = GameObject.Find("Upgrade Circle 4").GetComponent<Image>();
        upgrade5 = GameObject.Find("Upgrade Circle 5").GetComponent<Image>();
    }