예제 #1
0
 void Awake()
 {
     if (!_instance)
     {
         _instance = this;
         //            DontDestroyOnLoad(_instance);
     }
 }
 // Start is called before the first frame update
 void Start()
 {
     instance        = this;
     gamePlayManager = FindObjectOfType <GamePlayManager>();
     SetUpButton();
     corFuelSystem = StartCoroutine(FuelSystem(CarController.instance.fuel));
     SetCoin(PlayerPrefs.GetInt("Coin"));
 }
예제 #3
0
 public void Initialized()
 {
     transform.localPosition = initialPosition;
     targetPosition          = finalPosition;
     isMovingToFinalPosition = true;
     _isPlayerMoving         = false;
     _gamePlayManager        = GamePlayManager.GetInstance;
 }
예제 #4
0
    private bool isFryCount;             //フライカウントを減らす

    // Start is called before the first frame update
    void Start()
    {
        gameManager     = GetComponent <GamePlayManager>();
        fryCountManager = GetComponent <TurnManager>();
        conbo           = GetComponent <Conbo>();
        isFryCount      = false;           //最初はfalseで初期化
        isDeleteBlock   = false;           //最初はfalseで初期化
    }
예제 #5
0
 private void Start()
 {
     Gpm     = FindObjectOfType <GamePlayManager>();
     PGreen  = GameObject.Find("PedoneGreen");
     PBlue   = GameObject.Find("PedoneBlue");
     PRed    = GameObject.Find("PedoneRed");
     PYellow = GameObject.Find("PedoneYellow");
     CB      = FindObjectOfType <CombatManager>();
 }
 void Awake()
 {
     Application.targetFrameRate = 60;
     QualitySettings.vSyncCount  = 0;
     if (instance == null)
     {
         instance = this;
     }
 }
예제 #7
0
    private void OnEnable()
    {
        gamePlay = FindObjectOfType <GamePlayManager>();

        activeUnits = new List <Unit>();
        SpawnUnit();

        GameManager.Instance.OnGameOver += GameoverAct;
    }
예제 #8
0
 void Awake()
 {
     photonView = GetComponent <PhotonView>();
     if (GameObject.Find("GamePlayManager") == null)
     {
         return;
     }
     gameManager = GameObject.Find("GamePlayManager").GetComponent <GamePlayManager>();
 }
예제 #9
0
 private void Start()
 {
     Halo.enabled              = false;
     gamePlayManager           = FindObjectOfType <GamePlayManager>();
     IKControlScript           = GetComponentInParent <IKControl>();
     studentAction             = GetComponentInParent <StudentAction>();
     playerCamera              = Camera.main;
     updateStudentSelectedData = false;
 }
예제 #10
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.GetComponent <BulletHandler>() != null)
     {
         anim.SetTrigger("DieNow");
         //TODO: si es malo sumar puntos y si es bueno restar puntos.
         GamePlayManager.GetInstance().points += pointsHit;
     }
 }
예제 #11
0
    IEnumerator Stay()
    {
        yield return(new WaitForSeconds(waitTime));

        anim.SetTrigger("DieNow");

        //TODO: quitar puntos si es enemigo -> pointsMiss
        GamePlayManager.GetInstance().points += pointsMiss;
    }
 void Awake()
 {
     if (I == null)
     {
         I = this;
     }
     cm = FindObjectOfType <CardManager>();
     NextButton.gameObject.GetComponent <Image>().color = Color.green;
     CurrentIndex++;
 }
예제 #13
0
    public void InitPanel(GamePlayManager _gameplay)
    {
        currentGameplay = _gameplay;

        GameManager.Instance.OnGameOver += ShowGameoverPanel;

        _gameplay.OnBombsChanged      += SetLeftBombs;
        _gameplay.OnRemainTimeChanged += SetLeftTime;
        _gameplay.OnZombieChanged     += SetLeftZombies;
    }
예제 #14
0
 private void OnCollisionEnter2D(Collision2D collision)
 {
     if (collision.gameObject.CompareTag("EnemyProjectile") || collision.gameObject.CompareTag("PlayerProjectile"))
     {
         GetComponent <SpriteRenderer>().enabled = false;
         transform.GetChild(0).gameObject.SetActive(true);
         GamePlayManager GPM = GameObject.Find("Canvas").GetComponent <GamePlayManager>();
         StartCoroutine(GPM.GameOver());
     }
 }
예제 #15
0
    void Start()
    {
        GameEventManager.Initialize();
        mBags = new List <Bag>(2);

        mBoard = mBoardObject.GetComponent <Board>();
        mBoard.Initialize(kBoardSize);

        // Init shared game data.
        BoardController boardController = mBoard.Controller;

        Debug.Log("board controller " + boardController.ToString());

        DominoGenerator generator = new DominoGenerator(boardController.StartPosition, mDominoObject);

        Debug.Log("board controller" + generator.ToString());
        GamePlayManager.Initialize();
        GamePlayManager.Instance.Init(generator, mBoard.Controller, mDominoObject);

        // init draw bags
        {
            Bag bag = new Bag(kNumSlots, mBoard.Controller.Size, true);

            for (int i = 0; i < kNumSlots; i++)
            {
                Domino d = GamePlayManager.Instance.GetNextDomino();
                d.EnableGraphics(mBoard.Controller.Size);
                bag.AddDomino(d);
            }
            mBags.Add(bag);
        }

        {
            Bag bag = new Bag(kNumSlots, mBoard.Controller.Size, false);

            for (int i = 0; i < kNumSlots; i++)
            {
                Domino d = GamePlayManager.Instance.GetNextDomino();

                d.EnableGraphics(mBoard.Controller.Size);
                d.UpdateDominoLocation(mBoard.Controller.Size);
                bag.AddDomino(d);
            }
            mBags.Add(bag);
        }

        ActiveDomino = GamePlayManager.Instance.GetNextDomino().GetComponent <Domino>();
        if (mActiveDomino != null)
        {
            mActiveDomino.MakeActive();
        }
        mDominos.Add(ActiveDomino);
        ActiveDomino.EnableGraphics(mBoard.Controller.Size);
        ActiveDomino.SetHighlight(HighLightMode.Active);
    }
예제 #16
0
 public void OnPointerDown(PointerEventData eventData)
 {
     if (!GamePlayManager.Instance().isOver())
     {
         GamePlayManager.Instance().Fire();
         var pos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
         pos.z = 0f;
         var ob = GameObject.Instantiate(ArrowMiss, pos, Quaternion.identity, this.transform);
         ob.SetActive(true);
     }
 }
예제 #17
0
    private float lastUpdate = 0;                   // Time since last counter decrease

    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }
    }
예제 #18
0
 void UpdateMethod()
 {
     if (_gamePlayManager == null)
     {
         _gamePlayManager = GamePlayManager.GetInstance;
     }
     if (!_isPlayerMoving)
     {
         Activate();
     }
 }
예제 #19
0
 private void Awake()
 {
     if (_instance != null && _instance != this)
     {
         Destroy(this.gameObject);
     }
     else
     {
         _instance = this;
     }
 }
예제 #20
0
 public void accelerometerMode()
 {
     if (!GameController.instance.checkPaused())
     {
         if (GameController.instance.isFirstTime())
         {
             GameController.instance.tutorialEnable(true);
         }
     }
     GamePlayManager.SetISAccelerometerMode(true);
 }
예제 #21
0
 // Start is called before the first frame update
 void Start()
 {
     instance = this;
     player   = GameObject.FindGameObjectWithTag("Player");
     player.AddComponent <TriggersGamePlay>();
     lineFinish = null;
     lineStart  = GameObject.FindGameObjectWithTag("LineStart").transform;
     StartCoroutine(GetLineFinish());
     StartCoroutine(GetDistance());
     StartCoroutine(StartGame());
 }
예제 #22
0
 // Start is called before the first frame update
 private void Awake()
 {
     if (!Instance)
     {
         Instance = this;
     }
     else if (Instance)
     {
         Destroy(gameObject);
     }
 }
예제 #23
0
    public void OnStargeGameClick()
    {
        var mainUI       = Instantiate(MainUI);
        var mainDebugger = Instantiate(MainDebugger);

        GM = Instantiate(GM);
        GM.SetMainUI(mainUI);
        GM.Init();
        mainDebugger.SetGamePlayManager(GM);
        gameObject.SetActive(false);
    }
예제 #24
0
파일: TurnChange.cs 프로젝트: Can1210/untiy
    void Start()
    {
        turnManager = transform.GetComponent <TurnManager>();
        nowTurn     = Turn.Thinking; //最初は考えるターン
        turnChange  = false;         //最初はfalse
        roundEnd    = false;         //最初はfalse

        gameManager = GetComponent <GamePlayManager>();
        //fryModel = GetComponent<FryModel>();
        conbo = GetComponent <Conbo>();
    }
예제 #25
0
    /// <summary>
    /// Init metod
    /// </summary>
    private void Start()
    {
        _gamePlayManager        = _game.GetComponent <GamePlayManager>();
        transform.localPosition = _startingPosition;

        CpuPaddleAttrs.Height = transform.GetComponent <SpriteRenderer>().bounds.size.y;
        CpuPaddleAttrs.Widht  = transform.GetComponent <SpriteRenderer>().bounds.size.x;

        CpuPaddleAttrs.MaxX = transform.localPosition.x - CpuPaddleAttrs.Widht / 2;
        CpuPaddleAttrs.MinX = transform.localPosition.x + CpuPaddleAttrs.Widht / 2;
    }
예제 #26
0
        protected override void ResolveDependencies()
        {
            base.ResolveDependencies();

            var childFace = this.Owner.FindChild(GameConstants.ENTITYFACE);

            this.faceSprite    = childFace.FindComponent <Sprite>();
            this.timeToDismiss = TimeSpan.FromMilliseconds(this.TimeToDismiss);

            this.gamePlayManager = WaveServices.GetService <GamePlayManager>();
        }
예제 #27
0
    void Start()
    {
        source = GetComponent <AudioSource>();
        GamePlayManagerScript = GameObject.Find("GameManager").GetComponent <GamePlayManager>();

        ////Initialize time scale
        Time.timeScale = 1.0f;

        //Initialize player speed and effect
        MoveSideToSideCurrentSpeed = MoveSideToSideMinSpeed;
        accelerationEffect.Stop();
    }
예제 #28
0
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
예제 #29
0
    public void Initialize()
    {
        DataLoad.InitData();
        this.gamePlay = GamePlayTime.Instance;
        this.gamePlay.Initialize();

        PlayerManager.Instance.InstantiatePlayer();
        sacrificeCounts = new SacrificeCounts();

        this.player = PlayerManager.Instance.player;
        this.player.sacrificeCounts = this.sacrificeCounts;

        this.player.LiveChangesEvent += (int arg) => { if (arg <= 0)
                                                       {
                                                           GameOver();
                                                       }
        };


        enemyManager = EnemyManager.Instance;

        enemyManager.Init(this.player, this.sacrificeCounts);


        GameElementConstants.gameState = GameElementConstants.GameState.Start;


        this.UI = GamePlayManager.Instance;

        PlayerManager.Instance.player.LiveChangesEvent += this.UI.gamePlay.HUDScreen.playerLivesEventHandler;

        this.UI.Init();
        this.UI.gamePlay.WelcomeScreen.Init(this.UI.gamePlay.TapScreen.TapEvent);
        this.UI.gamePlay.WelcomeScreen.TapEvent += () =>
        {
            GameElementConstants.gameState = GameElementConstants.GameState.Playing;
            EnemyManager.Instance.InstantiateEnemyRandom();
            this.match.Init();
            this.match.UserInit();
            this.gamePlay.PausedEvent += this.match.user.Pause;
        };

        this.match = SelectorMatch.Instance;

        this.match.MatchedEvent += MatchedEventConnections();

        waveMechanic = new SpawnManager(this.enemyManager, this.player);
        this.gamePlay.SetPause(false);


        InitializeCombo();
    }
    // Controls the Input for the Game Over screen
    // SPACE to play again
    // ESC to quit the game
    void Update()
    {
        if (Input.GetButtonDown("Jump"))
        {
            GamePlayManager.resetGame();
            SceneManager.LoadScene("GameScene");
        }

        if (Input.GetButtonDown("Cancel"))
        {
            Application.Quit();
        }
    }
예제 #31
0
    void Start()
    {
        gpm = FindObjectOfType<GamePlayManager>();
        animator = GetComponent<Animator>();
        enemy_3d = GetComponent<Rigidbody>();
        animationStates = 3;
        playStates = true;
        deadFlag = false;
        numOfBomb = 0;

        BombFreq = Random.Range(250, 300);
        // veloH = (Random.Range(0, 2) == 0) ? true : false;
        // veloV = (Random.Range(0, 2) == 0) ? true : false;

        velo = new Vector3();
        velo.x = (Random.Range(0, 2) == 0) ? 0.5f : -0.5f;
        velo.y = (Random.Range(0, 2) == 0) ? 0.5f : -0.5f;
    }
    void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }

        m_ui = GameObject.Find("UIToolkit").GetComponent<UIToolkit>();
        m_uiText = GameObject.Find("UIToolkit-text").GetComponent<UIToolkit>();

        GameObject objMenu = GameObject.Find("Menus");

        _scoreScreen = GameObject.Find("ScoreScreen");
    }