public void Stop(MouseScript mouse) { if (!complete) { double mouse_fitness = mouse.GetGenotype_Fitness().GetFitness(); double[] mouse_genotype = (double[])mouse.GetGenotype_Fitness().GetGenotype().Clone(); genotype_fitness.Add(mouse.GetGenotype_Fitness().Clone()); Destroy(mouse.gameObject); if (mouse_fitness > best_fitness) { new_best = true; best_fitness = mouse_fitness; best_genotype = mouse_genotype; } act_mouse++; if (act_mouse == pop_size) { act_mouse = 0; GA(); } } else { Destroy(mouse.gameObject); } }
void Start() { sgltn = UMSingleton.Initialize(); log.OnGetLog += OnLogMessage; if (memberType == StartNetworkScript.MemberType.Server) { thread = new Thread(() => ServerListenMessage()); cameraObj.transform.position = new Vector3(0, 30, -70); cameraObj.AddComponent <FreeMovement>(); MouseScript ms = cameraObj.AddComponent <MouseScript>(); ms.minimumVert = -90; ms.maximumVert = 90; } else if (memberType == StartNetworkScript.MemberType.Client) { thread = new Thread(() => ClientListenMessage()); StartNetworkScript.um.Send(ToBinary(new BloMessage(MessageType.Connect, "First Network Test"))); } else { cameraObj.transform.position = new Vector3(0, 30, -70); cameraObj.AddComponent <FreeMovement>(); MouseScript ms = cameraObj.AddComponent <MouseScript>(); ms.minimumVert = -90; ms.maximumVert = 90; } thread?.Start(); log.Write("Start game as " + memberType.ToString()); Debug.Log(memberType.ToString()); }
public void Complete(MouseScript mouse) { complete = true; Debug.Log("Complete"); best_genotype = (double[])mouse.GetGenotype_Fitness().GetGenotype().Clone(); Destroy(mouse.gameObject); SpawnBestMouse(); }
void Start() { Time.timeScale = 1; shadeSpriteRenderer = pauseFilter.GetComponent<SpriteRenderer> (); ms = this.gameObject.GetComponent<MouseScript>(); Texture2D texture = new Texture2D (1, 1); texture.SetPixel (0, 0, shadeSpriteRenderer.color); Sprite sprite = Sprite.Create (texture, new Rect (0, 0, 2000, 2000), new Vector2 (0, 0)); shadeSpriteRenderer.sprite = sprite; pauseFilter.renderer.enabled = false; }
void Start() { Time.timeScale = 1; shadeSpriteRenderer = pauseFilter.GetComponent <SpriteRenderer> (); ms = this.gameObject.GetComponent <MouseScript>(); Texture2D texture = new Texture2D(1, 1); texture.SetPixel(0, 0, shadeSpriteRenderer.color); Sprite sprite = Sprite.Create(texture, new Rect(0, 0, 2000, 2000), new Vector2(0, 0)); shadeSpriteRenderer.sprite = sprite; pauseFilter.renderer.enabled = false; }
public override void Selected() { MouseScript.AddToSelectionQ(gameObject); //MouseScript.selectionQ.Add(gameObject); }
public override void Selected() { //if a room is clicked, depopulate the selection Q (unselect selected officers) MouseScript.ClearSelectionQ(); }
void Start() { mouseScript = GetComponent <MouseScript>(); }
void Awake() { if( instance == null ){ instance = this; } }
private void Awake() { instance = this; }