void Start() { _timerForBrain = 0f; //DeathScream = GetComponent<AudioSource>(); StartCoroutine(CalmState()); _playerLooker = GameObject.FindGameObjectWithTag("Player").GetComponent <MouseLooker>(); GameStatsTranslator.FireSlider = FireSlider; GameStatsTranslator._timerForBrain = _timerForBrain; }
private void Start() { //Score and score screen setup //GameOverTriggerText.SetActive(false); GameOverCanvas.gameObject.SetActive(false); GamePlayCanvas.gameObject.SetActive(true); ResumeGameButton.gameObject.SetActive(true); NextLevelButton.gameObject.SetActive(false); _alienCount = FindObjectsOfType <AlienController>(); //dohvaćam LockCurstor skriptu jer mi je potrebno omogućiti //kursor kad otvaram GaveOver i Pause canvase _mouseLooker = FindObjectOfType <MouseLooker>(); _gameMusicSource = GetComponent <AudioSource>(); _scoreTotal = _alienCount.Length; SetScoreScreen(_score); //ResetMusic(); }
void Start() { if (mouseLooker == null) { mouseLooker = this.gameObject.GetComponent <MouseLooker>(); } // start the game with the cursor locked LockCursor(true); // get a reference to the character's transform (which this script should be attached to) character = gameObject.transform; // get a reference to the main camera's transform cameraTransform = Camera.main.transform; // get the location rotation of the character and the camera m_CharacterTargetRot = character.localRotation; m_CameraTargetRot = cameraTransform.localRotation; }
// setup the game void Start() { // get a reference to the GameManager component for use by other scripts if (gm == null) { gm = this; } gameState = GameState.menu; if (!PlayerPrefs.HasKey("HighScore")) { PlayerPrefs.SetInt("HighScore", 0); } #if UNITY_STANDALONE || UNITY_EDITOR || UNITY_WEBGL ml = Player.GetComponent <MouseLooker>(); #endif sp = Spawner.GetComponent <SpawnGameObjects>(); }
private void Start() { // いろいろ取得 gameManager = GameObject.FindWithTag(Tags.GameManager).GetComponent <MyGameManager>(); humanMover = GetComponent <PlayerHumanMover>(); mouseLooker = GetComponent <MouseLooker>(); humanAnimator = GetComponent <HumanAnimator>(); humanGrabing = GetComponent <HumanGrabing>(); // 移動のスタート関数 humanMover.StartM(); if (photonView.IsMine) { // マウス移動のスクリプトはカメラの奪い合いが発生するので自分のだけ処理 mouseLooker.StartM(); humanGrabing.StartM(); } Resources.UnloadUnusedAssets(); camTr = Camera.main.transform; nameLabelTr = transform.Find("NameLabel"); nameLabelTr.GetComponent <TextMesh>().text = photonView.Owner.NickName; }
private void Start() { // いろいろ取得 gorillaMover = GetComponent <GorillaMover>(); mouseLooker = GetComponent <MouseLooker>(); gorillaAnimator = GetComponent <GorillaAnimator>(); humanGrabing = GetComponent <HumanGrabing>(); // 移動のスタート関数 gorillaMover.StartM(); if (photonView.IsMine) { // マウス移動のスクリプトはカメラの奪い合いが発生するので自分のだけ処理 mouseLooker.StartM(); } Resources.UnloadUnusedAssets(); camTr = Camera.main.transform; nameLabelTr = transform.Find("NameLabel"); nameLabelTr.GetComponent <TextMesh>().text = photonView.Owner.NickName; if (photonView.Owner.CustomProperties[Hashes.TeamColor] is int teamColor) { SetTeam((TeamColor)teamColor); } if (photonView.Owner.CustomProperties[Hashes.ID] is int id) { this.id = id; } AttackCollider mineAttackCollider = attackColliderObj.GetComponent <AttackCollider>(); mineAttackCollider.actorNumber = photonView.OwnerActorNr; mineAttackCollider.teamColor = this.teamColor; mineAttackCollider.attackerTransform = transform; attackColliderObj.SetActive(false); if (PhotonNetwork.IsMasterClient) { GameObject.FindWithTag(Tags.GameManager).GetComponent <MyGameManager>().UpdateHumanCount(this.teamColor); } }