示例#1
0
 void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
示例#2
0
    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));
    }
示例#3
0
 // 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>();
 }
示例#4
0
    private void Awake()
    {
        _FollowNavPoints = GetComponent<FollowNavPoints>();
        _Rigidbody = GetComponent<Rigidbody>();
        ResetPosition = GetComponent<ResetPosition>();
        Spookable = GetComponent<Spookable>();

        Spookable.OnSpooked = OnSpooked;
        Spookable.OnReset = OnSpookedReset;
    }
示例#5
0
 //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();
 }
示例#7
0
文件: GameManager.cs 项目: DiegoBV/IA
    private void resetGameObjects()
    {
        foreach (GameObject g in entities)
        {
            ResetPosition rp = g.GetComponent <ResetPosition>();

            if (rp != null)
            {
                rp.reset();
            }
        }
    }
示例#8
0
        /// <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();
 }
示例#10
0
 private void Awake()
 {
     Shoot = GetComponent<PlayerShoot>();
     ResetPosition = GetComponent<ResetPosition>();
 }
示例#11
0
 void Start()
 {
     playerCheckpoint = GetComponent <ResetPosition>();
 }
示例#12
0
 // Use this for initialization
 void Start()
 {
     _resetPosition = FindObjectOfType <ResetPosition>();
 }
示例#13
0
 // Use this for initialization
 void Start()
 {
     instance         = this;
     originalPosition = this.transform.position;
     this.GetComponent <Rigidbody>().isKinematic = true;
 }
示例#14
0
 private void Start()
 {
     rp = FindObjectOfType <ResetPosition>();
 }
示例#15
0
 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();
    }