Esempio n. 1
0
 void Awake()
 {
     if (!instance)
     {
         instance = this;
     }
 }
Esempio n. 2
0
 // 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;
            }
        }
    }
Esempio n. 4
0
 // 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> ();
 }
Esempio n. 5
0
 public void Initialize(ObjectsController controller)
 {
     objects = controller;
     if (objects.PlenAnimation != null)
     {
         objects.PlenAnimation.AnimationStarted     += AnimationStarted;
         objects.PlenAnimation.AnimationClipChanged += AnimationClipChanged;
         objects.PlenAnimation.AnimationEnded       += AnimationEnded;
     }
 }
Esempio n. 6
0
 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();
         }
     }
 }
Esempio n. 7
0
    // 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);
    }
Esempio n. 10
0
        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);
        }
Esempio n. 11
0
    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;
            }
        }
    }
Esempio n. 12
0
    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;
            }
        }
    }
Esempio n. 13
0
        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]);
            }
        }
Esempio n. 14
0
    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"
        });
    }
Esempio n. 15
0
 public void Initialize(ObjectsController controller)
 {
     objects = controller;
 }
Esempio n. 16
0
 public void Initialize(ObjectsController controller)
 {
     objects = controller;
     objects.Dialog.DialogFinished += new DialogFinishedEventHandler(DialogFinished);
 }
Esempio n. 17
0
 void Start()
 {
     objectsControllerScript = gameManager.GetComponent <ObjectsController>();
     audioControllerScript   = gameManager.GetComponent <AudioController>();
 }
Esempio n. 18
0
 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> ();
 }