コード例 #1
0
	// Use this for initialization
	void Start () {

		//Get sensor info for printing
		commit = GameObject.Find ("Commit");
		pie = commit.GetComponent<PieSliceSensor>();
		wall = commit.GetComponent<WallSensor>();
		adj = commit.GetComponent<AdjacentSensor>();
		ai = commit.GetComponent<AI> ();
	}
コード例 #2
0
ファイル: AI.cs プロジェクト: Monorail/Neural-Network-TD
	// Use this for initialization
	void Start () {
		pos = transform.position;
		player = GameObject.Find ("Commit");
		outputs = new double[2];
		net = new NeuralNetwork (9, 2, 6);
		net.readWeights ();
		ctrl = player.GetComponent<CommitController> ();
		wall = player.GetComponent<WallSensor> ();
		adj = player.GetComponent<AdjacentSensor> ();
		pie = player.GetComponent<PieSliceSensor> ();
	}
コード例 #3
0
 private void FindPlayerParts()
 {
     jump            = GetComponent <JumpControl>();
     characterSprite = GetComponentInChildren <SpriteRenderer>().gameObject;
     frogAnim        = characterSprite.GetComponent <AnimateFrog>();
     hand            = characterSprite.GetComponentInChildren <AimAtMouse>().gameObject;
     hookshotControl = hand.GetComponentInChildren <HookshotControl>();
     wallSensorRight = GameObject.Find("WallSensorR").GetComponent <WallSensor>();
     wallSensorLeft  = GameObject.Find("WallSensorL").GetComponent <WallSensor>();
     ceilingSensor   = GameObject.Find("CeilingSensor").GetComponent <CeilingSensor>();
     relative        = GameObject.Find("GroundColliders").GetComponent <RelativeVelocity>();
 }
コード例 #4
0
	public NeuralNetworkTrainer(GameObject player) {
		this.player = player;
		target = GameObject.Find ("timmoc");
		wall = this.player.GetComponent<WallSensor> ();
		//pie = GetComponent<PieSliceSensor> ();
		adj = this.player.GetComponent<AdjacentSensor> ();
		ctrl = this.player.GetComponent<CommitController> ();
		numWeights = (input * hidden) + (hidden * output) + (hidden + output);
		readWeights ();
		nn = new NeuralNetwork (input, output, hidden);
		nn.setWeights (weights);
		generation = 0;
	}
コード例 #5
0
ファイル: RopeControl.cs プロジェクト: EnigmaticaGH/Hookshot
 void FindWallSensors()
 {
     WallSensor[] sensors = player.getWallSensors();
     foreach (WallSensor sensor in sensors)
     {
         if (sensor.name == "WallSensorL")
         {
             leftWallSensor = sensor;
         }
         else if (sensor.name == "WallSensorR")
         {
             rightWallSensor = sensor;
         }
     }
 }
コード例 #6
0
 void FindWallSensors()
 {
     WallSensor[] sensors = GetComponent <LateralMovement>().getWallSensors();
     foreach (WallSensor sensor in sensors)
     {
         if (sensor.name == "WallSensorL")
         {
             wallSensorLeft = sensor;
         }
         else if (sensor.name == "WallSensorR")
         {
             wallSensorRight = sensor;
         }
     }
 }
コード例 #7
0
ファイル: JumpControl.cs プロジェクト: kjarosz/Hookshot
 void FindWallSensors()
 {
     WallSensor[] sensors = GetComponent<LateralMovement>().getWallSensors();
     foreach (WallSensor sensor in sensors)
     {
         if (sensor.name == "WallSensorL")
             wallSensorLeft = sensor;
         else if (sensor.name == "WallSensorR")
             wallSensorRight = sensor;
     }
 }
コード例 #8
0
ファイル: LateralMovement.cs プロジェクト: kjarosz/Hookshot
 private void FindPlayerParts()
 {
     jump = GetComponent<JumpControl>();
     characterSprite = GetComponentInChildren<SpriteRenderer>().gameObject;
     frogAnim = characterSprite.GetComponent<AnimateFrog>();
     hand = characterSprite.GetComponentInChildren<AimAtMouse>().gameObject;
     hookshotControl = hand.GetComponentInChildren<HookshotControl>();
     wallSensorRight = GameObject.Find("WallSensorR").GetComponent<WallSensor>();
     wallSensorLeft = GameObject.Find("WallSensorL").GetComponent<WallSensor>();
     ceilingSensor = GameObject.Find("CeilingSensor").GetComponent<CeilingSensor>();
     relative = GameObject.Find("GroundColliders").GetComponent<RelativeVelocity>();
 }
コード例 #9
0
 // Use this for initialization
 void Start()
 {
     rb2D = GetComponent <Rigidbody2D>();
     foot = transform.Find("Foot").GetComponent <Foot>();
     ws   = transform.Find("WallSensor").GetComponent <WallSensor>();
 }
コード例 #10
0
ファイル: RopeControl.cs プロジェクト: kjarosz/Hookshot
 void FindWallSensors()
 {
     WallSensor[] sensors = player.getWallSensors();
     foreach(WallSensor sensor in sensors) {
         if (sensor.name == "WallSensorL")
             leftWallSensor = sensor;
         else if (sensor.name == "WallSensorR")
             rightWallSensor = sensor;
     }
 }