// Start is called before the first frame update void Start() { wheelDrive = GetComponent <WheelDrive>(); rigidBody = GetComponent <Rigidbody>(); LoadFirstTarget(); }
void Start() { rBody = GetComponent <Rigidbody>(); wd = GetComponent <WheelDrive>(); time = 0.0f; roadbuilder = GetComponent <RoadBuilding>(); }
// Use this for initialization void Awake() { uiScript = FindObjectOfType <IngameUIScript>(); defaultColour = gameObject.transform.GetChild(0).GetChild(0).GetChild(0).gameObject.GetComponent <MeshRenderer>().material.color; renderer = gameObject.transform.GetChild(0).GetChild(0).GetChild(0).gameObject.GetComponent <Renderer>(); playerMove = gameObject.GetComponent <WheelDrive>(); rb = gameObject.GetComponent <Rigidbody>(); }
public override void Reset(Transform self, Transform target, Vector3 targetOffset) { if (target == null) { return; } m_vehicle = target.GetComponent <WheelDrive>(); }
// Start is called before the first frame update void Start() { btn_MessagePanelHide?.onClick.AddListener(() => { isActive = !isActive; SetPanelActive(isActive); }); wd = ObjTestCar.TestCar.WD; }
// Update is called once per frame void Update() { //sethealth = GameObject.FindGameObjectWithTag("Respawn").GetComponent<Health>(); if (timeBtwnSpawn <= 0) { num = rn.Next(1, 3); speedprob = rn.Next(1, 10); //print(num); WheelDrive carClonefamily = Instantiate(carOriginal); Transform trans = carClonefamily.transform; Transform sign = trans.Find("Canvas"); Transform msign = trans.Find("Canvas-maint"); msign.gameObject.SetActive(false); if (num == 1) { Transform Pathhb = GameObject.Find("Path").transform; carClonefamily.path = Pathhb; //carClonefamily.transform.GetChild(6).gameObject.SetActive(false); sign.gameObject.SetActive(false); //carClonefamily.yourSprite.SetActive(false); //print(yourSprite); } else { Transform Pathhb = GameObject.Find("Path2").transform; //yourSprite = GameObject.Find("Canvas"); //carClonefamily.yourSprite.SetActive(false); carClonefamily.path = Pathhb; sign.gameObject.SetActive(false); //carClonefamily.transform.GetChild("Canvas").gameObject.SetActive(false); } if (speedprob == 4 || speedprob == 7) { carClonefamily.maxSpeed = 200; carClonefamily.maxTorque = 170; sign.gameObject.SetActive(true); //carClonefamily.transform.GetChild("Canvas").gameObject.SetActive(true); //yourSprite = GameObject.Find("Canvas"); // carClonefamily.yourSprite.SetActive(true); //SGameObject yourSprite = GameObject.Find("Canvas"); //YourSprite.SetActive(False); //rb = carClonefamily.GetComponent<Rigidbody>(); //rb.velocity = transform.forward * 100; } //UnityEngine.Debug.Log(carClonefamily.transform.position); //Path.Path = Path; timeBtwnSpawn = startTimeBtwnSpwn; } else { timeBtwnSpawn -= Time.deltaTime; } }
public void WheelDrive_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) { WheelDrive wd = sender as WheelDrive; DataAccessLayer.DAL_Models.WheelDrive dal_gear = uof.WheelDrives.Get(wd.Id); dal_gear.Name = wd.Name; dal_gear.Image = wd.Image; uof.WheelDrives.CreateOrUpdate(dal_gear); uof.SaveChanges(); }
// Use this for initialization void Awake() { //Obtain the script properties gameManager = GameObject.Find("GameManager").GetComponent <GameStateManagerScript>(); rank = GameObject.Find("GameManager").GetComponent <RankScript>(); carCheckpoint = GameObject.FindGameObjectWithTag("Player2").transform.GetComponent <CarCheckpointScript>(); drive = GameObject.FindGameObjectWithTag("Player2").transform.GetComponent <WheelDrive>(); spriteRenderer = GameObject.FindGameObjectWithTag("Player2").transform.GetChild(16).transform.GetComponent <SpriteRenderer>(); //Don't render the game object displayRank.SetActive(false); }
void Awake() { Red = new RedNeuronal(7, 5, 2); IsVivo = true; IsArrancado = false; MovimientoCoche = gameObject.GetComponent <WheelDrive>(); Volante = GameObject.FindGameObjectWithTag("Volante"); Volante.transform.rotation = new Quaternion(0f, 0f, 0f, 1f); this.MatrizDePesos = new double[Red.Red.Conexiones.Count]; ultimaposicion = transform.position; }
// Use this for initialization void Start() { driver = FindObjectOfType <WheelDrive>().gameObject.GetComponent <WheelDrive>(); driver.enabled = true; Wsmoke.SetActive(true); Rsmoke.SetActive(false); Gsmoke.SetActive(false); Bsmoke.SetActive(false); // Debug.Log("hi"); RenderSettings.skybox = sky[0]; }
void Start() { widthPixels = (int)rawImage.rectTransform.rect.width; heightPixels = (int)rawImage.rectTransform.rect.height; m_Pixels = new Color32[widthPixels * heightPixels]; m_PixelsBg = new Color32[widthPixels * heightPixels]; for (int i = 0; i < m_Pixels.Length; i++) { m_PixelsBg[i] = ColorBG; } configs = new List <Config>(); texture = new Texture2D(widthPixels, heightPixels); rawImage.texture = texture; wd = ObjTestCar.TestCar.WD; }
public override void Reset(Transform self, Transform target, Vector3 targetOffset) { if (target == null) { return; } m_vehicle = target.GetComponent <WheelDrive>(); m_smoothLastPos = target.position + targetOffset; m_smoothVelocity = target.forward * 2.0f; m_smoothTargetAngle = target.eulerAngles.y; m_selfRotationAngle = self.eulerAngles.y; m_selfHeight = self.position.y; }
void Start() { Monitor.SetActive(true); //GetComponent<Rigidbody>().centerOfMass = new Vector3(0, -0.01f, -0.02f);//左右 上下 前后 wd = transform.GetComponent <WheelDrive>(); wd.scriptControl = true; List <Dropdown.OptionData> options = new List <Dropdown.OptionData>(); for (int i = 0; i < brains.Length; i++) { options.Add(new Dropdown.OptionData(brains[i].name)); } dropdown.options = options; dropdown.value = brains.Length - 1; }
private void Start() { Application.targetFrameRate = 60; wd = ObjTestCar.TestCar.WD; text_mode.text = TestConfig.TestMode.TestModeName; btn_carReset?.onClick.AddListener(() => { RResetCar(); OverLookCamera.Instance?.OLCameraReset(); }); btn_carPose?.onClick.AddListener(() => { ElementsManager.Instance.SetEditMode(ElementsManager.EditMode.SetCarPose); }); btn_addStatic?.onClick.AddListener(() => { ElementsManager.Instance.SetEditMode(ElementsManager.EditMode.SetStatic); }); btn_addHuman?.onClick.AddListener(() => { ElementsManager.Instance.SetEditMode(ElementsManager.EditMode.SetHuman); }); btn_addCarAI?.onClick.AddListener(() => { ElementsManager.Instance.SetEditMode(ElementsManager.EditMode.SetCarAI); }); btn_addCheckPoint?.onClick.AddListener(() => { ElementsManager.Instance.SetEditMode(ElementsManager.EditMode.SetCheckPoint); }); btn_Exit?.onClick.AddListener(() => { PanelExit.Instance.SetPanelActive(true); }); btn_saveMode?.onClick.AddListener(() => { TestDataManager.Instance.WriteTestJson(); }); btn_Settings?.onClick.AddListener(() => { PanelSettings.Instance.SetPanelActive(true); }); btn_VoyageSetting?.onClick.AddListener(() => { PanelVoyage.Instance.SetPanelActive(true); }); btn_cleanObstacles?.onClick.AddListener(ElementsManager.Instance.RemoveAllElements); text_version.text = Application.version; if (TestConfig.isEditMode) { for (int i = 0; i < SimuTools.Length; i++) { SimuTools[i].gameObject.SetActive(false); } } else { text_IP.text = ROS_Node.Config.ros_master_uri; for (int i = 0; i < EditTools.Length; i++) { EditTools[i].gameObject.SetActive(false); } } for (int i = 0; i < SimuScripts.Length; i++) { SimuScripts[i].enabled = !TestConfig.isEditMode; } }
public override void InitializeAgent() { environment.InitializeEnvironment(); rb = GetComponent <Rigidbody>(); wheels = GetComponent <WheelDrive>(); if (useSimplePhysics) { Destroy(wheels); WheelCollider[] wheelColliders = FindObjectsOfType <WheelCollider>(); foreach (WheelCollider wheelCollider in wheelColliders) { Destroy(wheelCollider); } rb.constraints = RigidbodyConstraints.FreezeRotation; } shovel = GetComponent <ShovelControl>(); vision = GetComponent <RobotVision>(); vision.InitializeDebrisArray(environment); sensors = GetComponent <RobotSensors>(); dropZone = environment.GetDropZone(); displayRewards = FindObjectOfType <DisplayRewards>(); startPosition = transform.position; startRotation = transform.rotation; lastCheckedPosition = startPosition; //AgentReset(); }
void Start() { DefaultPool d = (DefaultPool)(PhotonNetwork.PrefabPool); if (!d.ResourceCache.ContainsKey("car")) { d.ResourceCache.Add("car", car); } gameManager = this; Transform spawn = spawns.GetChild(spawnLocation); playerCar = PhotonNetwork.Instantiate("car", spawn.position, spawn.rotation); playerCar.tag = "LocalPlayer"; playerCar.transform.GetChild(0).gameObject.tag = "LocalPlayer"; WheelDrive w = playerCar.GetComponent <WheelDrive>(); Camera.main.GetComponent <DriftCamera>().SetTarget(w.lookAtTarget, w.positionTarget, w.sideView); ch = new Dictionary <GameObject, int>(); hc = new Dictionary <int, Transform>(); for (int i = 0; i < checkpoints.childCount; i++) { ch.Add(checkpoints.GetChild(i).gameObject, i); hc.Add(i, checkpoints.GetChild(i)); } PhotonNetwork.LocalPlayer.SetCustomProperties(new Hashtable { { MultiProperties.LAP, 0 }, { MultiProperties.CHECKPOINT, 0 } }); lap.text = "Lap " + currentLap + "/" + numOfLaps; cars = new Dictionary <Transform, Photon.Realtime.Player>(); }
void Start() { wheelDrive = this.GetComponent <WheelDrive>(); }
void Start() { rBody = GetComponent <Rigidbody>(); WheelDrive = GetComponent <WheelDrive>(); }
// Use this for initialization void Start() { motor = GetComponent <WheelDrive>(); }
private void Start() { gearEngine = GetComponent <GearEngine>(); wheelDrive = GetComponent <WheelDrive>(); nos = GetComponent <NosEngine>(); }
void Start() { driver = FindObjectOfType <WheelDrive>().gameObject.GetComponent <WheelDrive>(); driver.enabled = true; }
// Use this for initialization void Start() { playerWheelDrive = GameObject.FindGameObjectWithTag("Player").GetComponent <WheelDrive>(); }
// Use this for initialization void Start() { score = 0; penalty = 0; _WheelDrive = Car.GetComponent <WheelDrive>(); }
// Find all the WheelColliders down in the hierarchy. void Start() { carBodyRigidbody = carObject.GetComponent <Rigidbody>(); wd = carObject.GetComponent <WheelDrive>(); m_Wheels = carObject.GetComponentsInChildren <WheelCollider>(); Debug.Log(Application.persistentDataPath + Path.DirectorySeparatorChar + "parameter.json"); string jsonStr = ""; if (File.Exists(Application.persistentDataPath + Path.DirectorySeparatorChar + "parameter.json")) { jsonStr = File.ReadAllText(Application.persistentDataPath + Path.DirectorySeparatorChar + "parameter.json"); } else { jsonStr = Resources.Load <TextAsset>("parameter").text; } parameterJson = MiniJSON.jsonDecode(jsonStr) as Hashtable; slidersMultiples = new Dictionary <string, InputField>(); foreach (Slider slider in allSliders) { slider.value = -1; InputField inputField = Instantiate(inputFieldPrefab); inputField.gameObject.SetActive(true); inputField.transform.parent = slider.transform; inputField.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 0); inputField.onValueChanged.AddListener(delegate { slider.maxValue = float.Parse(inputField.text); parameterJson[slider.name + "_Times"] = inputField.text; SaveParameter(); }); (inputField.placeholder as Text).text = "倍数"; slidersMultiples.Add(slider.name, inputField); Text text = Instantiate(textPrefab); text.name = slider.name + "Text"; text.gameObject.SetActive(true); text.transform.parent = slider.transform; text.GetComponent <RectTransform>().anchoredPosition = new Vector2(0, 0); slider.onValueChanged.AddListener(delegate { SliderValueChange(slider.name, slider.value); parameterJson[slider.name] = slider.value; text.text = GetParameterAnnotation(slider.name) + "(" + slider.value + ") = " + slider.value + " "; SaveParameter(); }); if (!parameterJson.ContainsKey(slider.name)) { parameterJson.Add(slider.name, slider.value); } if (!parameterJson.ContainsKey(slider.name + "_Times")) { parameterJson.Add(slider.name + "_Times", inputField.text); } inputField.text = parameterJson[(slider.name + "_Times")].ToString(); slider.maxValue = float.Parse(inputField.text); slider.value = float.Parse(parameterJson[slider.name].ToString()); } inputFieldPrefab.gameObject.SetActive(false); textPrefab.gameObject.SetActive(false); List <Dropdown.OptionData> options = new List <Dropdown.OptionData>(); for (int i = 0; i < 3; i++) { options.Add(new Dropdown.OptionData(((DriveType)i).ToString())); } deiveTypeInput.options = options; deiveTypeInput.onValueChanged.AddListener(delegate { DriveTypeChange(); }); deiveTypeInput.value = 0; ParameterShowableChange(); }
void Start() { m_Wheels = GetComponentsInChildren <WheelCollider>(); m_CarController = GetComponent <WheelDrive>(); }