// Use this for initialization\ void Awake() { _PanelChooseMap.SetActive(true); anim = gameObject.GetComponent <Animator>(); anim.enabled = false; _animChooseMap = _PanelChooseMap.GetComponent <Animator>(); _animChooseMap.enabled = false; _SoundControler = FindObjectOfType <SoundControler>(); }
// Use this for initialization void Start() { _NumberText = FindObjectOfType <NumberTextScale>(); _GameControler = FindObjectOfType <GameControler>(); _UIManager = FindObjectOfType <UIManager>(); anim = gameObject.GetComponent <Animator>(); _SoundControler = FindObjectOfType <SoundControler>(); anim.enabled = false; }
//Bảo vệ trong vòng 3 turn //Đếm turn // Use this for initialization void Start() { _GameControler = FindObjectOfType <GameControler>(); Player player = gameObject.GetComponentInParent <Player>(); _UIManager = FindObjectOfType <UIManager>(); _SoundControler = FindObjectOfType <SoundControler>(); _SoundControler.PlayShieldSound(true); player._ISShield = true; }
// Use this for initialization void Start() { _UIManager = FindObjectOfType <UIManager>(); _cameraControler = FindObjectOfType <CameraControler>(); _numberText = GetComponent <NumberTextScale>(); _GameManager = FindObjectOfType <GameManager>(); _BgControler = FindObjectOfType <BackgoundSoundControler>(); _BgControler.PlayBackground(true); _SoundControler = FindObjectOfType <SoundControler>(); }
// Use this for initialization void Start() { GameObject other = GameObject.FindGameObjectWithTag("Map_Front"); xMax = other.transform.position.x + (other.GetComponent <BoxCollider2D>().size.x *other.transform.localScale.x) / 2; xMin = other.transform.position.x - (other.GetComponent <BoxCollider2D>().size.x *other.transform.localScale.x) / 2; yMin = other.transform.position.y - (other.GetComponent <BoxCollider2D>().size.y *other.transform.localScale.y) / 2; yMax = other.transform.position.y + (other.GetComponent <BoxCollider2D>().size.y *other.transform.localScale.y) / 2; collider = gameObject.GetComponent <BoxCollider2D>(); _SoundControler = FindObjectOfType <SoundControler>(); _PosStart = gameObject.transform.position; }
public ControlWindow() { InitializeComponent(); Bee = new BeeCompetition(); Sound = new SoundControler(); QuestionTimer = new DispatcherTimer(); QuestionTimer.Interval = new TimeSpan(0, 0, 1); QuestionTimer.Tick += new EventHandler(OnTimerTick); SetupRow.Height = new GridLength(); ControlRow.Height = new GridLength(0); SetStatus(); }
private void Awake() { if (_soundControler == null) { _soundControler = this; } else { Destroy(this); } _musicSource.clip = _musicIG; _musicSource.loop = true; _musicSource.Play(); }
//--------------------------------------- void Start() { trajectoryPoints = new List <GameObject>(); _GameControler = FindObjectOfType <GameControler>(); _UIManager = FindObjectOfType <UIManager>(); _SoundControler = FindObjectOfType <SoundControler>(); isPressed = isBallThrown = false; for (int i = 0; i < numOfTrajectoryPoints; i++) { GameObject dot = (GameObject)Instantiate(TrajectoryPointPrefeb); dot.transform.localScale = new Vector3((numOfTrajectoryPoints - i * 0.6f) * _scale, (numOfTrajectoryPoints - i * 0.6f) * _scale, (numOfTrajectoryPoints - i * 0.6f) * _scale); dot.GetComponent <Renderer>().enabled = false; trajectoryPoints.Insert(i, dot); } }
private void Awake() { if (_soundControler == null) { _soundControler = this; } else { Destroy(this); } _source = GetComponent <AudioSource>(); _source.clip = _music; _source.loop = true; _source.Play(); }
private void Awake() { if (_soundControler == null) { _soundControler = this; } else { Destroy(_soundControler.gameObject); } _source = GetComponent <AudioSource>(); _source.clip = _ambianceGuerre; _source.loop = true; _source.Play(); }
void Awake() { GameObject _Sound = GameObject.FindGameObjectWithTag("Sound"); if (_Sound != null) { Sound = _Sound.GetComponent <SoundControler>(); } data = GameData.GetInstance(); if (data == null) { Debug.Log("Error - Data did not load"); } }
private void Awake() { _myGC = this; _manager = GameManager._gameManager; _soundControler = SoundControler._soundControler; _animCamera = GetComponentInParent <Animator>(); AddMoney(0); _life.text = _hpPlayer.ToString(); _curentWave = -1; _roads.Insert(0, new GameObject().transform); int i = 0; foreach (var road in _roads) { _roadsTab.Add(new List <Transform>()); road.GetComponentsInChildren <Transform>(_roadsTab[i]); _roadsTab[i].Remove(road); i++; } }
//--------------------------------------- void Start() { lineRenderer = _PosInitBullet[1].GetComponent <LineRenderer>(); lineRenderer.enabled = true; lineRenderer.useWorldSpace = true; lineRenderer.sortingLayerName = "Middleground"; lineRenderer.sortingOrder = 1; //=========== trajectoryPoints = new List <GameObject>(); _GameControler = FindObjectOfType <GameControler>(); _UIManager = FindObjectOfType <UIManager>(); _SoundControler = FindObjectOfType <SoundControler>(); isPressed = isBallThrown = false; for (int i = 0; i < numOfTrajectoryPoints; i++) { GameObject dot = (GameObject)Instantiate(TrajectoryPointPrefeb); dot.transform.localScale = new Vector3((numOfTrajectoryPoints - i * 0.6f) * _scale, (numOfTrajectoryPoints - i * 0.6f) * _scale, (numOfTrajectoryPoints - i * 0.6f) * _scale); dot.GetComponent <Renderer>().enabled = false; trajectoryPoints.Insert(i, dot); } }
void Awake() { Sound = GameObject.FindGameObjectWithTag("Sound").GetComponent <SoundControler>(); }
// Use this for initialization void Start() { instance = this; }
// Use this for initialization void Start() { _SoundControler = FindObjectOfType <SoundControler>(); _GameControler = FindObjectOfType <GameControler>(); }
// INITIALIZATION ---------------------------------------------------------------------------------------------------- void Awake() { GameObject _Sound = GameObject.FindGameObjectWithTag("Sound"); if (_Sound != null) { Sound = _Sound.GetComponent <SoundControler>(); } // LOAD GAME DATA data = GameData.GetInstance(); if (data == null) { Debug.Log("Error - Data not found"); } // LOAD FACTORY COMPONENT factory = Factory.GetInstance(); if (factory == null) { Debug.Log("Error - Factory not found"); } else { factory.InitFactory(BLOCK_SIZE, Z_POS, block_ref, request_ref); } // LOAD GAME AREA GAME_AREA = GameObject.FindGameObjectWithTag("Game_Area"); if (GAME_AREA == null) { Debug.Log("Error - Game Area not found"); } // LOAD ENDSCREEN // GAME_ENDSCREEN = GameObject.FindGameObjectWithTag ("Game_EndScreen"); // if (GAME_ENDSCREEN == null) Debug.Log ("Error - EndScreen not found"); // else // GAME_ENDSCREEN.GetComponent<RuleInterfaceComponent>().Deactivate(); // GET BLOCK STARTING POSITION STARTING_POSITION = GameObject.FindGameObjectWithTag("Game_Start").transform.position; if (STARTING_POSITION == Vector3.zero) { Debug.Log("Error - Block Starting Position not found"); } else { STARTING_POSITION.z = Z_POS; } // GET REQUEST STARTING POSITION AREA_STARTING_POSITION = GameObject.FindGameObjectWithTag("Request_Start").transform.position; if (AREA_STARTING_POSITION == Vector3.zero) { Debug.Log("Error - Requst Starting Position not found"); } else { AREA_STARTING_POSITION.z = Z_POS; } // GET RULE LIST GameObject go_rulelist = GameObject.FindGameObjectWithTag("RuleList"); if (go_rulelist == null) { Debug.Log("Error - Rule List not found"); } else { ruleList = go_rulelist.GetComponent <RuleList> (); ruleList.SendMessage("SetRuleMax", rules_max); } }