Exemplo n.º 1
0
	// Use this for initialization
	void Start () {
		rigidBody = GetComponent<Rigidbody2D> ();
		anim = GetComponent<Animator> ();

		mainController = (MainGameController) GameObject.FindObjectOfType (typeof(MainGameController));
		canJump = true;
	}
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        // Retrieve the characterController
        character = GetComponent <CharacterController>();
        main      = Camera.main.GetComponent <MainGameController>();

        // inititialise the arrays used for manipulating the touch controls
        touchStartPosition = new Vector2[maxTouches];
        touchStartTime     = new float[maxTouches];
        touchState         = new InputState[maxTouches];

        #region GUI

        leftDragBtnStyle  = activeSkin.customStyles[0];
        rightDragBtnStyle = activeSkin.customStyles[0];

        float btnHeight = Screen.height * dragBtnScale;
        float btnWidth  = btnHeight * ((float)leftDragBtnStyle.normal.background.width /
                                       (float)leftDragBtnStyle.normal.background.height);
        float btnMargin = Screen.height * dragBtnMargin;

        float touchAreaWidth  = btnWidth * 2;
        float touchAreaHeight = btnHeight * 1.25f;

        leftDragBtnRect = new Rect(btnMargin, Screen.height - btnHeight - btnMargin,
                                   btnWidth, btnHeight);
        rightDragBtnRect = new Rect(Screen.width - btnWidth - btnMargin,
                                    Screen.height - btnHeight - btnMargin,
                                    btnWidth, btnHeight);
        leftTouchArea  = new Rect(0, 0, touchAreaWidth, touchAreaHeight);
        rightTouchArea = new Rect(Screen.width - touchAreaWidth, 0, touchAreaWidth, touchAreaHeight);

        #endregion
    }
Exemplo n.º 3
0
    string strStage = ""; //1-1みたいな

    // Use this for initialization
    void Start()
    {
        objMGController = objBoard.GetComponent <MainGameController>();

        ttsize   = ttData.GetLength(0);
        stageIdx = PuzzleMenuController.getStageIdx(); // ステージIDを取得
        setStage();
    }
Exemplo n.º 4
0
    /// <summary>
    /// Awake is used to initialize any variables or game state before the game starts.
    /// </summary>
    private void Awake()
    {
        // Create chunk queue
        InitializeChunks();

        // Set the game controller
        gameController = gameControllerObj.GetComponent <MainGameController>();
    }
Exemplo n.º 5
0
    public virtual void StartMultiplayer()
    {
        MainGameController.ShowHud(true);
        UINavigationController.DismissAllControllers();
        UINavigationController.DismissBackground("/MainBackground");

        MainGameController.StartMultiplayerGame();
    }
Exemplo n.º 6
0
    /// <summary>
    /// Use this for initialization
    /// </summary>
    private void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player");
        GameObject gameControllerObj = GameObject.FindGameObjectWithTag("GameController");

        gameController = gameControllerObj.GetComponent <MainGameController> ();
        audioSource    = gameObject.GetComponent <AudioSource> ();
    }
Exemplo n.º 7
0
        private void StartButton_Click(object sender, RoutedEventArgs e)
        {
            game = new MainGameController(ref blockTab, ref nextBlockTab, ref holdBlockTab, ref PlayerNick, ref Score, ref Combo, ref Record, ref DestroyedLines);

            KeyDown += GetKey;
            StartButton.IsEnabled = false;
            PlayerNick.IsEnabled  = false;
        }
 private void Awake()
 {
     CurrentHealth                  = MaxHealth;
     _uiController                  = FindObjectOfType <UIController>();
     _mainGameController            = FindObjectOfType <MainGameController>();
     ActiveEnemycontrollers         = new List <EnemyController>();
     ActiveThrowingEnemycontrollers = new List <ThrowingEnemyController>();
 }
Exemplo n.º 9
0
    protected virtual void StartGame()
    {
        MainGameController.ShowHud(true);
        UINavigationController.DismissAllControllers();
        UINavigationController.DismissBackground("/MainBackground");

        MainGameController.StartLocalSinglePlayerGame();
    }
Exemplo n.º 10
0
	// Use this for initialization
	void Start () {
		obstacle = GetComponent<Obstacle> ();
		mainController = (MainGameController) GameObject.FindObjectOfType (typeof(MainGameController));
		values = 0;
		foreach (Switch sw in switches) {
			if (sw.value)
				values++;
		}
	}
Exemplo n.º 11
0
	// Use this for initialization
	void Start () {
		obstacle = GetComponent<Obstacle> ();
		mainController = (MainGameController) GameObject.FindObjectOfType (typeof(MainGameController));
		values = 0;
		foreach (WindowLvl1 window in windows) {
			if (window.isClosed)
				values++;
		}
	}
Exemplo n.º 12
0
    // Use this for initialization
    void Start()
    {
        Board            = GameObject.Find("Board");
        script           = Board.GetComponent <MainGameController>();
        gobjOGController = GameObject.Find("OnlineGameController");
        diceSizeHalf     = transform.localScale.x / 2f;

        sound_roll = GetComponent <AudioSource>();
    }
Exemplo n.º 13
0
        public void LoadKeysEmptyFileTest()
        {
            var view       = new Mock <IMainGameView>();
            var controller = new MainGameController(view.Object);

            controller.LoadKeysResources("");

            controller.Chars.Count.ShouldBe(0);
        }
Exemplo n.º 14
0
        public void SubscribeToEventsTest()
        {
            var view = new Mock <IMainGameView>();

            view.Setup(x => x.SubscribeGlobalEvents());
            var controller = new MainGameController(view.Object);

            view.VerifyAll();
        }
Exemplo n.º 15
0
    public void UpdatePlayerImage()
    {
        Vector2 pos = -_waypointPanel.transform.localPosition;

        pos.x = MainGameController.Map(pos.x, -8192, 8192, -250, 250);
        pos.y = MainGameController.Map(pos.y, -8192, 8192, -250, 250);
        _playerImage.transform.localPosition    = pos;
        _playerImage.transform.localEulerAngles = _boat.transform.localEulerAngles + _boatImageOffset;
    }
Exemplo n.º 16
0
        private void OnDisable()
        {
            MainGameController instance = MainGameController.Instance;

            if (instance == null)
            {
                return;
            }
            instance.DeregisterHighFixedTimestepBehavior(this);
        }
Exemplo n.º 17
0
    public void ShowQuestionsPanel(QuestionData.question q)
    {
        SetButtonEnabled(true);

        MainGameController.ShowHud(false);
        UINavigationController.PushBackground("/MainBackground");
        UINavigationController.PushController(questionDialog);

        PrepareQuestion(q);
    }
Exemplo n.º 18
0
        public void SupressTaskSwitchTest()
        {
            var view       = new Mock <IMainGameView>();
            var controller = new MainGameController(view.Object);

            controller.IsShouldSupressKey(Keys.Tab, true, true).ShouldBe(true);
            controller.IsShouldSupressKey(Keys.Tab, true, false).ShouldBe(true);
            controller.IsShouldSupressKey(Keys.Tab, false, true).ShouldBe(false);
            controller.IsShouldSupressKey(Keys.Tab, false, false).ShouldBe(false);
        }
Exemplo n.º 19
0
    // Use this for initialization
    void Start()
    {
        // Retrieve the characterController
        character = GetComponent <CharacterController>();
        main      = Camera.main.GetComponent <MainGameController>();

        // inititialise the arrays used for manipulating the touch controls
        touchStartPosition = new Vector2[maxTouches];
        touchStartTime     = new float[maxTouches];
        touchState         = new InputState[maxTouches];
    }
    void Start()
    {
        this.GetComponent <Rigidbody>().isKinematic = true;
        swing            = 1f;
        originalPosition = transform.position;
        //print("Orignial Position" + originalPosition.ToString());
        multi = Random.Range(1, 4);
        GameObject controllerObject = GameObject.Find("Main Game Controller");

        controller = controllerObject.GetComponent <MainGameController>();
    }
Exemplo n.º 21
0
 void Awake()
 {
     if (current == null)
     {
         current = this;
     }
     else if (current != this)
     {
         Destroy(gameObject);
     }
 }
Exemplo n.º 22
0
    void Start()
    {
        GetComponent <FadeController>().FadeIn();
        truckInfos = MainGameController.getTruckInfos();

        int[] highScores = ScoreManager.GetData(SelectController.stageNum);
        highScore          = highScores[SelectController.getSelectStageNum()];
        highPriceText.text = highScore.ToString();

        confirmButton.interactable = false;
    }
Exemplo n.º 23
0
 public void UpdateOpponent()
 {
     for (int i = 0; i < _opponents.Count; i++)
     {
         GameObject opponent = _opponents[i];
         Vector2    pos      = opponent.transform.GetChild(0).localPosition;
         pos.x = MainGameController.Map(pos.x, -8192, 8192, -250, 250);
         pos.y = MainGameController.Map(pos.y, -8192, 8192, -250, 250);
         _opponentImages[i].transform.localPosition    = pos;
         _opponentImages[i].transform.localEulerAngles = opponent.transform.GetChild(0).localEulerAngles + _boatImageOffset;
     }
 }
Exemplo n.º 24
0
    /// <summary>
    /// Awake is used to initialize any variables or game state before the game starts.
    /// </summary>
    private void Awake()
    {
        GameObject gameControllerObj = GameObject.FindGameObjectWithTag("GameController");

        gameController = gameControllerObj.GetComponent <MainGameController> ();

        // Get mine prefab and make it a child object
        GameObject minePrefab = Resources.Load <GameObject> ("Prefabs/Mine");

        mine = Instantiate(minePrefab, transform.position, transform.rotation);
        mine.transform.parent = transform;
    }
Exemplo n.º 25
0
 // Update is called once per frame
 void Update()
 {
     if (transform.position.y >= 10)
     {
         Destroy(this.gameObject);
         if (noBalon == 4)
         {
             MainGameController.GetInstance().kuisSelesai = true;
             MainGameController.GetInstance().TambahSkor(-10);
         }
     }
 }
Exemplo n.º 26
0
 private void Awake()
 {
     BlockTransform             = GetComponent <Transform>();
     _gameField                 = FindObjectOfType <GameField>();
     _blockCollider             = GetComponent <Collider2D>();
     _healthPointsText          = gameObject.GetComponentInChildren <Text>();
     _blockSpriteRenderer       = GetComponent <SpriteRenderer>();
     _blockSpriteRenderer.color = HealthGradient.Evaluate(Mathf.Floor(HealthPoints) / 50);
     _gameController            = FindObjectOfType <MainGameController>();
     _destroyPosition           = new Vector2();
     DestroyParticle.Stop();
 }
    // Use this for initialization
    void Start()
    {
        GameObject controllerObject = GameObject.Find("Main Game Controller");

        controller = controllerObject.GetComponent <MainGameController>();
        hand       = side.GetComponent <JointPositioner>().JointToTrack.ToString();

        GameObject configObject = GameObject.Find("Game Settings");

        config         = configObject.GetComponent <GameConfig>();
        spinMultiplier = config.indicatorSpinSpeed;
    }
Exemplo n.º 28
0
        public void ProcessKeyTest()
        {
            var view = new Mock <IMainGameView>();

            view.Setup(x => x.PlaySound(It.IsAny <int>(), 100));

            var controller = new MainGameController(view.Object);

            controller.LoadKeysResources(TestKeyFileResource);

            controller.ProcessKey(Keys.R);
            view.VerifyAll();
        }
Exemplo n.º 29
0
    public void EnterTankField(MainGameController _mainController)
    {
        mainController = _mainController;
        gameStage      = GameStage.preparing;
        foreach (PhotonPlayer player in PhotonNetwork.playerList)
        {
            RegisterPlayer((int)player.CustomProperties["index"]);
        }

        ExitGames.Client.Photon.Hashtable sideNumHash = new ExitGames.Client.Photon.Hashtable();
        sideNumHash.Add("SideNum", PlayerNumEachSide);
        PhotonNetwork.room.SetCustomProperties(sideNumHash);
    }
    // Start is called before the first frame update
    void Start()
    {
        MainGameController.setIsFinish(false);

        nextButton.SetActive(false);
        priceText.SetActive(false);
        sentence.SetActive(false);
        price = MainGameController.getTotalPrice();
        Invoke("Appear", 0.40f);
        Invoke("Delete", 4.10f);

        oscController = GameObject.Find("OSCManager").GetComponent <OSCController>();
    }
Exemplo n.º 31
0
    // Use this for initialization
    void Start()
    {
        ttData[0, 2] += PlayerPrefs.GetString("userName") + "さん。";

        objBoard        = GameObject.Find("Board");
        objMGController = objBoard.GetComponent <MainGameController>();

        objTT           = GameObject.Find("TutorialText");
        objTTController = objTT.GetComponent <TutorialTextController>();

        maxDataIdx = ttData.GetLength(0);
        setNext();
    }
Exemplo n.º 32
0
    // Use this for initialization
    void Start()
    {
        playerSubFarmCount = 1;
        subFarms           = new GameObject[transform.childCount];
        uiController       = GameObject.FindObjectOfType <UIController>();
        mainGameController = GameObject.FindObjectOfType <MainGameController>();
        saveLoadController = GameObject.FindObjectOfType <SaveLoadController>();

        CheckSubFarmCount();

        currentActiveSubFarmIndex = 0;
        SetSubFarmActive(0);
    }
Exemplo n.º 33
0
        public void SupressRightMouseClickTest()
        {
            var view       = new Mock <IMainGameView>();
            var controller = new MainGameController(view.Object);

            controller.IsShouldSupressMouse(MouseButtons.Left).ShouldBe(false);
            controller.IsShouldSupressMouse(MouseButtons.Middle).ShouldBe(false);
            controller.IsShouldSupressMouse(MouseButtons.Right).ShouldBe(true);
            controller.IsShouldSupressMouse(MouseButtons.Middle).ShouldBe(false);
            controller.IsShouldSupressMouse(MouseButtons.None).ShouldBe(false);
            controller.IsShouldSupressMouse(MouseButtons.XButton1).ShouldBe(false);
            controller.IsShouldSupressMouse(MouseButtons.XButton2).ShouldBe(false);
        }
Exemplo n.º 34
0
	// Use this for initialization
	void Start (){
		anim = GetComponent<Animator> ();
		obstacle = GetComponent<Obstacle> ();
		mainController =(MainGameController)GameObject.FindObjectOfType (typeof(MainGameController));
		rotated = false;
	}
Exemplo n.º 35
0
 public virtual void Awake()
 {
     mainGameController = this;
 }
Exemplo n.º 36
0
	// Use this for initialization
	void Start () {
		obstacle = GetComponent<Obstacle> ();
		mainController = (MainGameController) GameObject.FindObjectOfType (typeof(MainGameController));

	}