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")); }
public void Initialized() { transform.localPosition = initialPosition; targetPosition = finalPosition; isMovingToFinalPosition = true; _isPlayerMoving = false; _gamePlayManager = GamePlayManager.GetInstance; }
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で初期化 }
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; } }
private void OnEnable() { gamePlay = FindObjectOfType <GamePlayManager>(); activeUnits = new List <Unit>(); SpawnUnit(); GameManager.Instance.OnGameOver += GameoverAct; }
void Awake() { photonView = GetComponent <PhotonView>(); if (GameObject.Find("GamePlayManager") == null) { return; } gameManager = GameObject.Find("GamePlayManager").GetComponent <GamePlayManager>(); }
private void Start() { Halo.enabled = false; gamePlayManager = FindObjectOfType <GamePlayManager>(); IKControlScript = GetComponentInParent <IKControl>(); studentAction = GetComponentInParent <StudentAction>(); playerCamera = Camera.main; updateStudentSelectedData = false; }
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; } }
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++; }
public void InitPanel(GamePlayManager _gameplay) { currentGameplay = _gameplay; GameManager.Instance.OnGameOver += ShowGameoverPanel; _gameplay.OnBombsChanged += SetLeftBombs; _gameplay.OnRemainTimeChanged += SetLeftTime; _gameplay.OnZombieChanged += SetLeftZombies; }
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()); } }
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); }
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); } }
private float lastUpdate = 0; // Time since last counter decrease private void Awake() { if (instance == null) { instance = this; } else { Destroy(gameObject); } }
void UpdateMethod() { if (_gamePlayManager == null) { _gamePlayManager = GamePlayManager.GetInstance; } if (!_isPlayerMoving) { Activate(); } }
private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); } else { _instance = this; } }
public void accelerometerMode() { if (!GameController.instance.checkPaused()) { if (GameController.instance.isFirstTime()) { GameController.instance.tutorialEnable(true); } } GamePlayManager.SetISAccelerometerMode(true); }
// 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()); }
// Start is called before the first frame update private void Awake() { if (!Instance) { Instance = this; } else if (Instance) { Destroy(gameObject); } }
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); }
void Start() { turnManager = transform.GetComponent <TurnManager>(); nowTurn = Turn.Thinking; //最初は考えるターン turnChange = false; //最初はfalse roundEnd = false; //最初はfalse gameManager = GetComponent <GamePlayManager>(); //fryModel = GetComponent<FryModel>(); conbo = GetComponent <Conbo>(); }
/// <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; }
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>(); }
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(); }
void Awake() { if (Instance == null) { Instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
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(); } }
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"); }