void Awake() { if (!instance) { instance = this; } }
// Start is called before the first frame update void Start() { //Gets hold of the necessary components timerControllerScript = this.GetComponent <TimerController>(); //timer.text = timerControllerScript.initialTime.ToString(); objectsControllerScript = this.GetComponent <ObjectsController>(); }
public void SetObjects() { for (int i = 0; i < this.initialObjects.Length; i++) { int randomIndex = Random.Range(0, this.initialObjects.Length); this.newObject = Instantiate(this.initialObjects[randomIndex]) as GameObject; this.newObjController = this.newObject.GetComponent <ObjectsController>(); if (i > 0) { this.positionToInstantiate.y += this.newObjController.colliderRadius * 2 * i; } this.newObject.transform.SetParent(this.spawnPositionFirstObj); this.newObject.transform.position = this.positionToInstantiate; this.SetDirection(); this.objects.Enqueue(newObjController); this.positionToInstantiate = this.spawnPositionFirstObj.position; if (i == this.initialObjects.Length - 1) { this.spawnPositionLastObj = this.newObject.transform.localPosition; } } }
// Use this for initialization void Start() { isActive = true; isReplace = false; isWait = false; thisCollider = this.GetComponent <Collider2D> (); btnArray = this.GetComponentsInChildren <Button> (); objectsController = GameObject.Find("ObjectsController").GetComponent <ObjectsController> (); parentPanelFrames = GameObject.Find("PanelFrames").GetComponent <PanelFramesScript> (); }
public void Initialize(ObjectsController controller) { objects = controller; if (objects.PlenAnimation != null) { objects.PlenAnimation.AnimationStarted += AnimationStarted; objects.PlenAnimation.AnimationClipChanged += AnimationClipChanged; objects.PlenAnimation.AnimationEnded += AnimationEnded; } }
public void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.CompareTag("Object")) { this.objcontroller = other.gameObject.GetComponent <ObjectsController>(); if (!this.objcontroller.ejected) { this.objcontroller.ejected = true; this.spawner.InstantiateNewObject(); } } }
// Start is called before the first frame update void Start() { wordsArray = this.GetComponent <LoadData>().LoadFile(); timerControllerScript = this.GetComponent <TimerController>(); objectsControllerScript = this.GetComponent <ObjectsController>(); audioControllerScript = this.GetComponent <AudioController>(); scoreControllerScript = this.GetComponent <ScoreController>(); spawnLetterScript = lettersObject.GetComponent <SpawnLetters>(); updateObjectsList(wordsArray); objectsList.gameObject.SetActive(false); }
// Start is called before the first frame update void Start() { Time.timeScale = 1f; //Sets current time as the initial time currentTime = memorizeTime; totalTime = 0; leaderboardControllerScript = GameObject.Find("LeaderboardController").GetComponent <LeaderboardController>(); playerPrefsScript = this.GetComponent <PlayerPreferences>(); objectsControllerScript = this.GetComponent <ObjectsController>(); audioControllerScript = this.GetComponent <AudioController>(); }
public void InstantiateNewObject() { int randomIndex = Random.Range(0, this.objectsToSpawn.Length); this.newObject = Instantiate(this.objectsToSpawn[randomIndex]) as GameObject; this.newObjController = newObject.GetComponent <ObjectsController>(); this.newObject.transform.SetParent(this.spawnPositionFirstObj); this.newObject.transform.localPosition = this.spawnPositionLastObj; this.SetDirection(); this.objects.Enqueue(this.newObjController); }
public void Get_ShouldReturnWelcomeMessage() { // Arrange. var controller = new ObjectsController(); controller.Request = HttpRequestHandler.GenerateHttpRequestMessage(); var expected = "Welcome to Wind API! - ObjectsController"; // Act. var result = controller.Get(); // Assert. Assert.IsNotNull(result); var getResult = result.Content.ReadAsAsync <string>().Result; Assert.AreEqual(expected, getResult); }
public void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.CompareTag("Object")) { this.obj = other.gameObject.GetComponent <ObjectsController>(); this.shieldHealth += this.obj.GetEffectPoints(); this.obj.TryDestroyObject(); this.particleManager.PlayParticle(0, other.contacts[0].point); ChangeColor(); if (this.shieldHealth <= 0) { this.shiledCollider.enabled = false; } } }
public void OnCollisionEnter2D(Collision2D other) { if (other.gameObject.CompareTag("Object")) { this.obj = other.gameObject.GetComponent <ObjectsController>(); this.coreHealth += this.obj.GetEffectPoints(); this.obj.TryDestroyObject(); this.particleManager.PlayParticle(2, other.contacts[0].point); if (this.coreHealth <= 0) { //big explosion this.particleManager.PlayParticle(1, other.contacts[0].point); PlayerController.isDead = true; this.coreCollider.enabled = false; } } }
public void CheckADObject_ValidComputer_ShouldReturnCodeAndQueryResult() { // Arrange. var controller = new ObjectsController(); controller.Request = HttpRequestHandler.GenerateHttpRequestMessage(); var adObject = TestConstants.ComputerPrimary; var expected = ADObjectCheckResultGenerator.GenerateADObjectCheckResultForValidComputer(); // Act. var result = controller.CheckADObject(adObject); // Assert. Assert.IsNotNull(result); var adObjectCheckResult = result.Content.ReadAsAsync <ADObjectCheckResult>().Result; Assert.IsTrue(adObjectCheckResult.code == 2); Assert.AreEqual(expected.code, adObjectCheckResult.code); Assert.AreEqual(expected.adObject, adObjectCheckResult.adObject); for (int i = 0; i < adObjectCheckResult.queryResult.Count; i++) { Assert.AreEqual(expected.queryResult[i], adObjectCheckResult.queryResult[i]); } }
public StateController(GameObject cp, GameObject op, GameObject sp, GameObject gp, GameObject si, GameObject ss, GameObject dt, GameObject pp, GameObject lm, GameObject dc) { this.place = last_place = MAIN_SCREEN; this.controlPanel = cp; this.optionsPanel = op; this.successPanel = sp; this.congratzPanel = gp; this.soundIcon = si; this.successSound = ss; this.descriptionText = dt; this.previewImages = pp; this.leapObject = lm; this.discoCamera = dc; volume = 100; bloom = 0; oc = new ObjectsController(); animations = new List<Animation>(); this.animations.Add(op.GetComponent<Animation>()); this.animations.Add(cp.GetComponent<Animation>()); this.animations.Add(sp.GetComponent<Animation>()); this.animations.Add(gp.GetComponent<Animation>()); tutorialAnimations = new List<string>(new string[] { "goto_rotate", "goto_switch", "goto_pick", "goto_circular" }); toMainAnimations = new List<string>(new string[] { "", "main_from_zoom", "main_from_rotate", "main_from_switch", "main_from_pick", "main_from_circular", "main_from_lab" }); }
public void Initialize(ObjectsController controller) { objects = controller; }
public void Initialize(ObjectsController controller) { objects = controller; objects.Dialog.DialogFinished += new DialogFinishedEventHandler(DialogFinished); }
void Start() { objectsControllerScript = gameManager.GetComponent <ObjectsController>(); audioControllerScript = gameManager.GetComponent <AudioController>(); }
public void Initialize(ObjectsController controller) { // nop }
// Use this for initialization void Start() { isActive = true; isReplace = false; isWait = false; thisCollider = this.GetComponent<Collider2D> (); btnArray = this.GetComponentsInChildren<Button> (); objectsController = GameObject.Find ("ObjectsController").GetComponent<ObjectsController> (); parentPanelFrames = GameObject.Find ("PanelFrames").GetComponent<PanelFramesScript> (); }