void Start() { if (instance == null) { instance = this; } }
public void FindClosestPoint1() { // ARRANGE var reset = new ResetPosition(); var body = new Rigidbody(); var pos = new Vector3(0, 0, 0); var p1 = new GameObject(); var p2 = new GameObject(); p1.transform.position = new Vector3(0, 5, 0); p2.transform.position = new Vector3(0, 10, 0); GameObject[] points = new GameObject[2]; points[0] = p1; points[1] = p2; var expected = p1; // ACT var closest = reset.ResetCurrentCar(body, pos, points); // ASSERT Assert.That(closest, Is.EqualTo(expected)); }
// Start is called before the first frame update void Start() { playerRB = GetComponent <Rigidbody2D>(); playerSPR = GetComponent <SpriteRenderer>(); playerReset = GetComponent <ResetPosition>(); playerAnim = GetComponent <Animator>(); playerCols = GetComponents <BoxCollider2D>(); }
private void Awake() { _FollowNavPoints = GetComponent<FollowNavPoints>(); _Rigidbody = GetComponent<Rigidbody>(); ResetPosition = GetComponent<ResetPosition>(); Spookable = GetComponent<Spookable>(); Spookable.OnSpooked = OnSpooked; Spookable.OnReset = OnSpookedReset; }
//Initialise objects void Start() { Rigidbody = GetComponent <Rigidbody>(); backProp = new BackPropNetwork(); Rigidbody.GetComponent <CarPhysics>().driver = Driver.BackProp; controller = new CarController(); saveLoad = new BackPropWeights(); Rigidbody.GetComponent <Sensor>().sensorLenght += 5; position = new ResetPosition(); }
//Initialise objects void Start() { Rigidbody = GetComponent <Rigidbody>(); Outputs = new List <double>(); Car = new GeneticNetwork(); saveLoad = new GeneticWeights(); controller = new CarController(); Rigidbody.GetComponent <CarPhysics>().driver = Driver.AI; position = new ResetPosition(); LoadChild(); }
private void resetGameObjects() { foreach (GameObject g in entities) { ResetPosition rp = g.GetComponent <ResetPosition>(); if (rp != null) { rp.reset(); } } }
/// <summary> /// Reset the internal cipher and associated state. Optionally, attempt to /// set the position of the stream <see cref="Binding"/> to a new position. /// </summary> /// <param name="resetPosition"> /// What position to attempt to set the current stream <see cref="Binding"/> to. /// Default is 'None' (left at current position). /// </param> public void Reset(ResetPosition resetPosition = ResetPosition.None) { _opInBuffer.SecureWipe(); _opBufferOffset = 0; _opOutBuffer.SecureWipe(); _inBuffer.Reset(); _outBuffer.Reset(); _cipher.Reset(); BytesIn = 0; BytesOut = 0; Finished = false; }
//Initialise objects void Start() { Rigidbody = GetComponent <Rigidbody>(); Reset.onClick.AddListener(ResetCurrent); Restart.onClick.AddListener(RestartCurrent); LearningRate = LearningModeScript.LearningRate; NoLaps = LearningModeScript.NoLaps; backProp = new BackPropNetwork(); Rigidbody.GetComponent <CarPhysics>().driver = Driver.USER; controller = new CarController(); saveLoad = new BackPropWeights(); Rigidbody.GetComponent <Sensor>().sensorLenght += 5; position = new ResetPosition(); }
private void Awake() { Shoot = GetComponent<PlayerShoot>(); ResetPosition = GetComponent<ResetPosition>(); }
void Start() { playerCheckpoint = GetComponent <ResetPosition>(); }
// Use this for initialization void Start() { _resetPosition = FindObjectOfType <ResetPosition>(); }
// Use this for initialization void Start() { instance = this; originalPosition = this.transform.position; this.GetComponent <Rigidbody>().isKinematic = true; }
private void Start() { rp = FindObjectOfType <ResetPosition>(); }
void InvokeResetPosition(RotationEventArgs e) { ResetPosition?.Invoke(this, e); }
private float avoidPathOffset; // direction (-1 or 1) in which to offset path to avoid other car, whilst avoiding private void Start() { Rigidbody = GetComponent <Rigidbody>(); Rigidbody.GetComponent <CarPhysics>().driver = Driver.UnityAI; position = new ResetPosition(); }