private void Start() { _rb = GetComponent <Rigidbody>(); _col = GetComponent <CapsuleCollider>(); _gameManager = GameObject.Find("GameManager").GetComponent <GameBehaviour>(); }
//Setting void Start() { if (GameBehaviour.gb == null) { GameBehaviour.gb = this; } else { Destroy(this.gameObject); } DontDestroyOnLoad(this); Starter.s.button.SetActive(true); players = new List <Player> (); Table = new List <Card>(); Deck = new List <Card>(CardValue.Count * CardType.Count); for (int i = 0; i < CardValue.Count; i++) { for (int j = 0; j < CardType.Count; j++) { Deck.Add(new Card(CardValue [i], CardType[j])); } } // Instantiate(StartGame); }
public void RegisterListener(GameBehaviour _eventableToAdd) { if (!gameBehaviours.Contains(_eventableToAdd)) { gameBehaviours.Add(_eventableToAdd); } }
public static void PlayCorrectAnswerSound(GameBehaviour target) { if (CurrentUserInfo.IsSoundEnabled) { target.GetComponent <AudioSource>().Play(); } }
void Start() { game = GameBehaviour.Instance; camera_obj = GetComponent <Camera>(); player_body = player.GetComponent <Rigidbody2D>(); player_logic = player.GetComponent <PlayerLogic>(); }
public void GoToLeaderbords(AudioSource audio) { GameBehaviour behave = GameObject.FindGameObjectWithTag("GameBehaviour").GetComponent <GameBehaviour>(); behave.GoToLeaderbords(audio); }
public void GoToMothership(AudioSource audio) { GameBehaviour behave = GameObject.FindGameObjectWithTag("GameBehaviour").GetComponent <GameBehaviour>(); behave.GoToMothership(audio); }
// Update is called once per frame void Update() { GameManager = GameObject.Find("GameManager").GetComponent <GameBehaviour>(); vInput = Input.GetAxis("Vertical") * VitesseMouvement; hInput = Input.GetAxis("Horizontal") * VitesseRotation; }
public static void PlayLostSound(this GameBehaviour target) { if (CurrentUserInfo.IsSoundEnabled) { target.GetComponent <AudioSource>().Play(); } }
private void onNewState(int state) { //Debug.Log("on new state"); if (state == hitState) { this.sumDeltaTime = 0.0f; } else if (state == waitingState) { GameBehaviour behaviour = GameObject.FindObjectOfType <GameBehaviour>(); behaviour.reserveTentacle(gameObject); if (this.sumDeltaTime > 0.0) { timestamps.Add(this.sumDeltaTime); } this.sumDeltaTime = 0.0f; } else if (state == idleState) { this.sumDeltaTime = 0.0f; } ObjectState = state; }
private void checkFuelOnOutOfBounds() { if (fuel <= 0.0f) { GameBehaviour.changeGameState(GameBehaviour.GameState.Finish); } else { float actual_fuel_lost; if (fuel < FUEL_LOST_ON_EXPLOSION) { actual_fuel_lost = fuel; } else { actual_fuel_lost = FUEL_LOST_ON_EXPLOSION; } fuel -= actual_fuel_lost; display_behaviour.updateStandbyMessage("Your lander disappeared\n" + ((int)actual_fuel_lost).ToString() + " units of fuel lost"); GameBehaviour.changeGameState(GameBehaviour.GameState.Standby); } lander_animator.SetTrigger("LanderExplosion"); }
private void checkFuelOnCrash() { if (fuel <= 0.0f) { GameBehaviour.changeGameState(GameBehaviour.GameState.Finish); } else { float actual_fuel_lost; if (fuel < FUEL_LOST_ON_EXPLOSION) { actual_fuel_lost = fuel; } else { actual_fuel_lost = FUEL_LOST_ON_EXPLOSION; } fuel -= actual_fuel_lost; display_behaviour.updateStandbyMessage("Your lander exploded\n" + ((int)actual_fuel_lost).ToString() + " units of fuel lost"); GameBehaviour.changeGameState(GameBehaviour.GameState.Standby); } lander_animator.SetTrigger("LanderExplosion"); AudioSource.PlayClipAtPoint(explosion_audio_clip, transform.position, AUDIO_CLIPS_VOLUME); }
public void UnregisterListener(GameBehaviour _eventableToRemove) { if (gameBehaviours.Contains(_eventableToRemove)) { gameBehaviours.Remove(_eventableToRemove); } }
void Start() { _gameArchive = File.ReadAllLines(SavePath + "ArchiveData.txt").ToList(); _games = new List <GameBehaviour>(); var gameManagers = GameManager.LoadGamesFromFile(SavePath + "CurrentGame.txt"); _playerUiSettings = PlayerUiSettings.Load(); _games.Add(GameBehaviour.CreateGameBehaviour(gameObject, GuiSkin, BoardTile, Piece, Text, ((short)0).ToCartesianCoordinate(), gameManagers.First(), _gameArchive, _playerUiSettings)); _activeGame = _games.First(); _searchMethods = new[] { new GUIContent("NegaMax"), new GUIContent("NegaMax w/ Alpha-Beta") }; _searchDepths = new[] { new GUIContent("Search Depth 0"), new GUIContent("Search Depth 1"), new GUIContent("Search Depth 2"), new GUIContent("Search Depth 3"), new GUIContent("Search Depth 4"), new GUIContent("Search Depth 5"), new GUIContent("Search Depth 6"), new GUIContent("Search Depth 7"), }; _searchComboBox.SelectedItemIndex = _playerUiSettings.SearchMethod; _depthComboBox.SelectedItemIndex = _playerUiSettings.SearchDepth; listStyle.normal.textColor = Color.white; listStyle.onHover.background = listStyle.hover.background = new Texture2D(2, 2); listStyle.padding.left = listStyle.padding.right = listStyle.padding.top = listStyle.padding.bottom = 4; }
private void Start() { var g = GameObject.Find("DaGame"); if (g) { _game = g.gameObject.GetComponent <GameBehaviour>(); } GetComponent <Fuel>().OnFuelAmountChanges() .Skip(1) .Take(1) .Subscribe(f => { _game.WoodBurning.Value++; _isBurning = true; }) .AddTo(gameObject); this.OnDestroyAsObservable() .Subscribe(unit => { if (_isBurning) { _game.WoodBurning.Value--; } }) .AddTo(gameObject); }
// Use this for initialization void Start() { transform.Rotate(0, -90, 0); anim = this.gameObject.GetComponent <Animator>(); gameManager = GameObject.Find("GameManager").GetComponent <GameBehaviour>(); }
public IEnumerator BeforeEveryInstanceTest() { var prefab = Resources.Load <GameBehaviour>("Game"); yield return(null); instance = Object.Instantiate(prefab); }
void Start() { rb = this.GetComponent <Rigidbody2D>(); gb = GameObject.FindObjectOfType <GameBehaviour>(); anim = this.transform.GetComponent <Animator>(); sr = this.transform.GetComponent <SpriteRenderer>(); myTurn = 0; }
public void TransformTest() { GameObject go = new GameObject("TransformTest"); GameBehaviour t = go.AddComponent <GameBehaviour>(); Assert.IsNotNull(t.GetTransform()); ObjectUtility.Destroy(go); }
public void Resolve(GameWinObserver gameWinObserver, GameBehaviour game, SimulationTime time) { _time = time; _game = game; _winObserver = gameWinObserver; _winObserver.WinnerFoundEvent += OnWinnerFound; }
private void Start() { //set the players Rigidbody to the _rb variable _rb = GetComponent <Rigidbody>(); _col = GetComponent <CapsuleCollider>(); _gameManager = GameObject.Find("GameManager").GetComponent <GameBehaviour>(); }
private void Awake() { this.gameBehaviour = GameBehaviour.Instance; if (this.gameBehaviour != null) { this.gameBehaviour.GameChanged += this.OnGameChanged; } }
void Start() { game = GameBehaviour.Instance; plane_body = GetComponent <Rigidbody2D>(); plane_collider = GetComponent <PolygonCollider2D>(); projectilePrefab = game.getProjectileType(projectileType); setMaxHealth(maxHealth); setHealth(getMaxHealth()); }
// Use this for initialization void Start() { networkManager = GameObject.FindGameObjectWithTag("GameController").GetComponent <CommunicationBehaviour>(); sparkGenerator = GameObject.Find("SparkGenerator"); currHP = totalHP; manabar = GameObject.Find("PortalManaBar").GetComponent <Slider>(); manabar.value = 0; behaviour = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameBehaviour>(); }
private void Start() { var g = GameObject.Find("DaGame"); if (g) { _game = g.gameObject.GetComponent <GameBehaviour>(); } _game.ChoppedWood.Value = true; }
void Awake() { if (Game == null) { DontDestroyOnLoad (gameObject); Game = this; } else if (Game != this) { Destroy(gameObject); } }
private void Start() { var g = GameObject.Find("DaGame"); if (g) { _game = g.gameObject.GetComponent <GameBehaviour>(); } _game.OneStoneSharpened.Value = true; }
// Use this for initialization protected override void FetchReferences() { base.FetchReferences(); game = GameBehaviour.Instance; ui.SetPlayer(this); xVec = 0; yVec = 0; xIn = xDir.none; yIn = yDir.none; }
void Start() { game = GameBehaviour.Instance; if (transform.position.y < (game.getWaterLevel() + 10)) { var exp_pos = transform.position; exp_pos.z = 0; exp_pos.y = game.getWaterLevel(); Instantiate(waterExplosion_fx, exp_pos, Quaternion.identity); } }
public static void RemoveFromGame(GameObject victim) { GameBehaviour handler = victim.GetComponent <GameBehaviour>(); if (handler) { handler.RemoveFromGame(); } else { RequestDefaultDestruction(victim); } }
IEnumerator ShowAll() { while (queue.Count > 0) { ShowNext(); while (clicked == null) { yield return(null); } } gameObject.SetActive(false); GameBehaviour.ContinueGame(); }