Inheritance: MonoBehaviour
コード例 #1
0
 //Scripts
 void Awake()
 {
     _findSpawner = GameObject.Find("Spawner");
     _scoreController = GameObject.Find("ScoreController");
     _checkCoins = _scoreController.GetComponent<CoinsController>();
     _checkWaveRunning = _findSpawner.GetComponent<UnitSpawner>();
 }
コード例 #2
0
    void Start()
    {
        _scoreController = GameObject.Find("ScoreController");
        _checkCoins = _scoreController.GetComponent<CoinsController>();

        _EnemyHpScaler = (_Enemyhealth / 2);
    }
コード例 #3
0
    void Start()
    {
        _scoreController = GameObject.Find("ScoreController");
        _checkCoins      = _scoreController.GetComponent <CoinsController>();

        _EnemyHpScaler = (_Enemyhealth / 2);
    }
コード例 #4
0
 private void Awake()
 {
     InGamePanel.SetActive(true);
     _coinsController = FindObjectOfType <CoinsController>();
     CoinsText.text   = _coinsController.GetCoinsAmount().ToString();
     SetGradientsAlpha(1, 1);
 }
コード例 #5
0
ファイル: CameraController.cs プロジェクト: pashka39933/Accu
    // Use this for initialization
    void Start()
    {
        cameraDest = this.transform.position;

        CoinsController cc = GameObject.FindObjectOfType <CoinsController>();

        Instantiate(cc.characters[PlayerPrefs.GetInt("Character", 0)]);
    }
コード例 #6
0
        public App05Game()
        {
            graphicsManager       = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            IsMouseVisible        = true;

            coinsController = new CoinsController();
        }
コード例 #7
0
        public CoinsControllerTests()
        {
            var mockCoinsService = new Mock <ICoinsService>();

            mockCoinsService.Setup(x => x.GetCoins()).Returns(TestData.Coins.Take(2));

            coinsController = new CoinsController(mockCoinsService.Object);
        }
コード例 #8
0
    //Scripts

    void Awake()
    {
        _findSpawner        = GameObject.Find("Spawner");
        _checkWaveRunning   = _findSpawner.GetComponent <UnitSpawner>();
        _scoreController    = GameObject.Find("ScoreController");
        _checkCoins         = _scoreController.GetComponent <CoinsController>();
        _messagesController = GameObject.Find("MessageController");
        _checkMessage       = _messagesController.GetComponent <Messages>();
    }
コード例 #9
0
    void Start()
    {
        _hover = GameObject.Find("Hover");
        _placeScript = _hover.GetComponent<PlacementMouse>();
        _scoreController = GameObject.Find("ScoreController");
        _checkCoins = _scoreController.GetComponent<CoinsController>();

        _removeBuilding = GameObject.Find("RemoveButton");
        _removeBuilding.GetComponent<Button>().onClick.AddListener(removeBool);
    }
コード例 #10
0
    void Start()
    {
        _hover           = GameObject.Find("Hover");
        _placeScript     = _hover.GetComponent <PlacementMouse>();
        _scoreController = GameObject.Find("ScoreController");
        _checkCoins      = _scoreController.GetComponent <CoinsController>();

        _removeBuilding = GameObject.Find("RemoveButton");
        _removeBuilding.GetComponent <Button>().onClick.AddListener(removeBool);
    }
コード例 #11
0
        public async Task TestGetIDSuccessfully()
        {
            using (var context = new CryptoCognizantContext(options))
            {
                CoinsController     coinsController = new CoinsController(context, _mapper);
                ActionResult <Coin> result          = await coinsController.GetCoin(0);

                Assert.IsNotNull(result);
            }
        }
コード例 #12
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
コード例 #13
0
 private void Awake()
 {
     Time.timeScale    = 1f;
     _playerMovement   = FindObjectOfType <PlayerMovement>();
     _artController    = FindObjectOfType <ArtController>();
     _uiController     = FindObjectOfType <UIController>();
     _lvlBuilder       = FindObjectOfType <LVLBuilder>();
     _saveController   = FindObjectOfType <SaveController>();
     _coinsController  = FindObjectOfType <CoinsController>();
     _healthController = FindObjectOfType <HealthController>();
     StartLvl();
 }
コード例 #14
0
        /// <summary>
        /// Setup the game window size to 720P 800 x 1400 pixels
        /// Simple fixed playing area with no camera or scrolling
        /// </summary>
        protected override void Initialize()
        {
            graphicsManager.PreferredBackBufferWidth  = HD_Width;
            graphicsManager.PreferredBackBufferHeight = HD_Height;

            graphicsManager.ApplyChanges();

            graphicsDevice = graphicsManager.GraphicsDevice;


            coinsController = new CoinsController();

            base.Initialize();
        }
コード例 #15
0
        public async Task TestPutCoinNoContentStatusCode()
        {
            using (var context = new CryptoCognizantContext(options))
            {
                Boolean newFav = false;
                Coin    coin1  = context.Coin.Where(x => x.IsFavourite == coins[0].IsFavourite).Single();
                coin1.IsFavourite = newFav;

                CoinsController coinsController = new CoinsController(context, _mapper);
                IActionResult   result          = await coinsController.PutCoin(coin1.CoinId, coin1) as IActionResult;

                Assert.IsNotNull(result);
                Assert.IsInstanceOfType(result, typeof(NoContentResult));
            }
        }
コード例 #16
0
        public async Task TestDeleteSuccessfully()
        {
            using (var context = new CryptoCognizantContext(options))
            {
                CoinsController coinsController = new CoinsController(context, _mapper);

                ActionResult <IEnumerable <Coin> > result1 = await coinsController.GetCoin();

                ActionResult <Coin> delete = await coinsController.DeleteCoin(0);

                ActionResult <IEnumerable <Coin> > result2 = await coinsController.GetCoin();

                // Assert that coin list changes after coin is deleted
                Assert.AreNotEqual(result1, result2);
            }
        }
コード例 #17
0
ファイル: Facade.cs プロジェクト: Inseus/KillAllNeighbors
 public Facade(Form1 playerBoard, Player boardPlayer, CreatorOfPictureBox creator, Timer a, Timer b, Timer c)
 {
     state               = new StartGame();
     gameTimer           = a;
     moveTimer           = b;
     requestTimer        = c;
     coinsController     = new CoinsController();
     creatorOfPictureBox = creator;
     this.playerBoard    = playerBoard;
     this.player         = boardPlayer;
     connectionHandler   = new ConnectionHandler(boardPlayer);
     enemyList           = new List <Enemy>();
     h1 = new YouWon();
     h2 = new YouLost();
     h1.SetSuccessor(h2);
     gameAction();
 }
コード例 #18
0
        public CoinsControllerTests()
        {
            _mockCoinService           = new Mock <ICoinService>();
            _mockCountryService        = new Mock <ICountryService>();
            _mockCollectorValueService = new Mock <ICollectorValueService>();
            _mockCoinService.Setup(c => c.Save()).ReturnsAsync(true);
            _mockCountryService.Setup(c => c.CountryExists(It.IsAny <Guid>())).ReturnsAsync(true);

            _mockCollectorValueService
            .Setup(c => c.FindCollectorValueByValues(It.IsAny <CollectorValue>()))
            .ReturnsAsync(new CollectorValue());

            _controller = new CoinsController(_mockCoinService.Object,
                                              _mockCountryService.Object, _mockCollectorValueService.Object, _mapper);
            SetupTestController(_controller);

            _builder                  = new CoinTestBuilder();
            resourceParameters        = new CurrenciesResourceParameters();
            resourceParameters.Fields = "Id, Type";
        }
コード例 #19
0
    /**
     *  Initialization
     */
    void Start()
    {
        groundMaterial  = LayerMask.GetMask("Ground");
        groundDetection = GameObject.Find("GroundCollision").GetComponent <Transform>();

        game         = GameObject.Find("GameManager").GetComponent <GameController>();
        coinsManager = GameObject.Find("CoinManager").GetComponent <CoinsController>();

        maxSpeed = 7.5f;
        switch (PlayerPrefs.GetInt("Speed"))
        {
        case 1:
            startSpeed += (maxSpeed - startSpeed) / 2;
            break;

        case 2:
            startSpeed = maxSpeed;
            break;

        default:
            break;
        }

        playerBody            = GetComponent <Rigidbody2D>();
        playerAnimator        = GetComponent <Animator>();
        groundDetectionRadius = GetComponent <BoxCollider2D>().size.x / 2;
        lastCharacterPosition = transform.position.x;

        onGround      = false;
        isBendDown    = false;
        leftArm       = false;
        rightArm      = false;
        playerFalling = false;

        startTime = Time.time;

        runSound.Play();
    }
コード例 #20
0
ファイル: PlayerController.cs プロジェクト: pashka39933/Accu
    // Use this for initialization
    void Start()
    {
        iceCollider     = GameObject.Find("IceCollider").transform;
        comboHolder     = GameObject.Find("ComboHolder");
        forceImage      = GameObject.Find("PowerBar").GetComponent <Image>();
        scoreText       = GameObject.Find("Score").GetComponent <Text>();
        camController   = GameObject.Find("Main Camera Container").GetComponent <CameraController>();
        bgController    = GameObject.Find("Main Camera").GetComponent <BackgroundColorController>();
        coinsController = GameObject.FindObjectOfType <CoinsController>();
        playerParticles = this.GetComponent <EllipsoidParticleEmitter>();

        Time.timeScale = 3.67f;

        rb = this.GetComponent <Rigidbody>();

        spotPrefab.GetComponent <SpriteRenderer>().sprite = spotSprites[0];
        currentSpot = (GameObject)Instantiate(spotPrefab, new Vector2(this.transform.position.x, this.transform.position.y + 5.925f - ((float)Random.Range(0, 450) / 100)), Quaternion.identity);

        iceCollider.transform.rotation = Quaternion.Euler(new Vector3(90, 0, 0));
        this.transform.rotation        = Quaternion.identity;

        scoreText.text = score.ToString();
    }
コード例 #21
0
    /**
     *  Initialization
     */
    void Start()
    {
        deathMenu          = GameObject.Find("DeathMenu").gameObject;
        deathMenuScore     = GameObject.Find("DeathMenuScore").GetComponent <Text>();
        deathMenuHighScore = GameObject.Find("DeathMenuHighScore").GetComponent <Text>();
        caloriesGoalText   = GameObject.Find("CaloriesGoalText").GetComponent <Text>();

        gameManager     = FindObjectOfType <GameController>();
        scoreManager    = FindObjectOfType <ScoreController>();
        coinsManager    = FindObjectOfType <CoinsController>();
        caloriesManager = FindObjectOfType <CaloriesController>();
        timeManager     = FindObjectOfType <TimeController>();

        timer = PlayerPrefs.GetInt("Timer");

        if (timer > 0)
        {
            timeManager.SetIsDead(true);
            timeManager.FixPreviousTime();
        }

        DisplayScoring();
    }
コード例 #22
0
    IEnumerator UpdatePointsCoroutine(int points)
    {
        CoinsController cc          = CoinsController.instance;
        string          textPoints  = LANG.GetText(12);
        string          textCoins   = LANG.GetText(34);
        int             temp        = 0;
        int             temp2       = 0;
        int             pointsTotal = points;
        float           time        = 0.2f;

        if (pointsTotal >= 30)
        {
            time = 0.1f;
        }
        while (temp <= points)
        {
            yield return(new WaitForSeconds(time));

            temp++;
            temp2++;
            if (temp2 == 10)
            {
                cc.coinsOnRun++;
                pointTextAnim.SetTrigger("OnePlusTrigger");
                coinsTakenTXT.text = textCoins + ": " + cc.coinsOnRun;
                temp2 = 0;
            }
            pointsText.text = textPoints + ": " + temp;
        }
        cc.SetCoins(cc.coinsOnRun);
        isPoints = true;
        Debug.Log("isPoints");
        if (isPoints && isLevel)
        {
            goBackButton.SetActive(true);
        }
    }
コード例 #23
0
 void Awake()
 {
     current = this;
 }
コード例 #24
0
 // Start is called before the first frame update
 void Start()
 {
     Instance = this;
 }
コード例 #25
0
 //Scripts
 void Awake()
 {
     _scoreController = GameObject.Find("ScoreController");
     _checkCoins = _scoreController.GetComponent<CoinsController>();
 }
コード例 #26
0
 public CoinsControllerTests()
 {
     _coinsController = new CoinsController(_mediator.Object);
 }
コード例 #27
0
 /// <summary>
 /// Create a controller for coins with one coin
 /// </summary>
 private void SetupCoins()
 {
     coinsController = new CoinsController(game);
 }
コード例 #28
0
ファイル: CoinsController.cs プロジェクト: wajdi107/GP
 // Use this for initialization
 void Start()
 {
     sharedInstance         = this;
     coinsCount             = Constants.Tool_Price - GameManager.sharedInstance.litRoomsNumber;
     coinsCounterLabel.text = coinsCount.ToString();
 }
コード例 #29
0
 void Awake()
 {
     controller = this;
 }
コード例 #30
0
 void Start()
 {
     I     = this;
     coins = PlayerPrefs.GetInt("coins", 2);
 }