public void setOnAllCars() { GameMngr gameMngr = gameMngrObj.GetComponent <GameMngr>(); gameMngr.setOnAllCars(); gameMngr.statsAddStartRaceCount(); }
bool setStatistics(int _playerPlace) { GameMngr gameMngrTmp = gameMngrObj.GetComponent <GameMngr>(); gameMngrTmp.statsEndRace(_playerPlace); return(true); }
void OnTriggerEnter2D(Collider2D hitInfo) { if (hitInfo.name == "Ball") { var wallName = transform.name; GameMngr.Score(wallName); hitInfo.gameObject.SendMessage("ResetBallTimer"); } }
public override void CalculateHit(int amount) { base.CalculateHit(amount); if (HitPoints <= 0) { GameMngr.IncrementScore(); Destroy(this.gameObject); } }
public override void CalculateHit(int amount) { //Remove heart from UI UserInterface.DecreasePlayerHealth(); base.CalculateHit(amount); if (HitPoints <= 0) { GameMngr.EndGame(); } }
void Start() { stackColorCode = DataScript.currentColorCode; isFallingFinished = false; isFallingOnGround = false; height = 0; ikControl = GetComponentInParent <IKControl>(); collectedCubes = new List <Transform>(); gameMngr = FindObjectOfType(typeof(GameMngr)) as GameMngr; playerController = GetComponentInParent <PlayerController>(); }
void OnTriggerEnter2D(Collider2D hitInfo) { if (hitInfo.name == "Ball") { var wallName = transform.name; GameMngr.Score(wallName); hitInfo.gameObject.SendMessage("ResetBallTimer"); audioSource = GetComponent <AudioSource>(); audioSource.clip = scoreSound; audioSource.Play(); } }
void RpcTeamColor(int t) { if (!gm) { gm = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameMngr>(); } //Debug.Log(gm.clientTeam); //Debug.Log(t); if (gm.clientTeam == t) { slider.GetComponent <Image>().color = Color.blue; } }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); enemies = new List <Enemy>(); boardScript = GetComponent <BoardManager>(); //InitGame(); }
public void gameInit() { //Debug.Log("init"); gm = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameMngr>(); //CmdAssignConnection(); //CmdUpdateScore(netId); CmdGetSpawn(); GameObject ab = GameObject.FindGameObjectWithTag("Abil"); if (ab) { abilities = ab.GetComponent <AbilSelector>(); gm.popAs(abilities); } }
void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); board_script = GetComponent <BoardMngr>(); InitGame(); }
void CmdGetSpawn() { #region Assign connections gm = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameMngr>(); #endregion //NetworkInstanceId spawnID = sv.assignSpawn(); ServerMngr.spawnInfo spnI = sv.getSpawn(myConId); NetworkConnection nc = connectionToClient; spawn = NetworkServer.FindLocalObject(spnI.sid); team = spnI.team; gm.assignConnection(connectionToClient, netId, team); //for (uint i = 0; i < 10; i++) //{ // print(i + " cmd " + NetworkServer.FindLocalObject(new NetworkInstanceId(i))); //} TargetSetSpawn(nc, spnI.sid); }
void Start() { mainMenuMngr = mainMenuInterfaceObj.GetComponent <MainMenuManager>(); playerData = playerDataObj.GetComponent <PlayerData>(); actualNrTrack = playerData.getActualTrack(); actualLvl = playerData.getActualLvl(); minLvl = playerData.getMinLvl(); maxLvl = playerData.getMaxLvl(); nrLvlText = nrLvlTextObj.GetComponent <Text>(); setNrLvlText(); checkRangeNrLvl(); gameMngr = gameMngrObj.GetComponent <GameMngr>(); textMoney = textMoneyObj.GetComponent <Text>(); upgrades = upgradesObj.GetComponent <UpgradesManager>(); advMgr = gameMngr.getAdvMgr(); statisticsInterface = statisticsInterfaceObj.GetComponent <StatisticsInterfaceManager>(); checkSoundsBtnOption(); shopMgr = shopObj.GetComponent <ShopManager>(); trackBtnMnr = trackBtnObj.GetComponent <LvlNrInterfaceTrackBtnMnr>(); advBtnLvlNrMgr = advBtnLvlNrMgrObj.GetComponent <LvlNrInterfaceAdButtonManager>(); }
// Use this for initialization void Awake() { gm = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameMngr>(); }
IEnumerator gameInit() { while (!players.TrueForAll(p => p.ghost.connectionToClient.isReady)) { yield return(null); } //foreach(Player p in players) //{ // NetworkServer.SetClientReady(p.ghost.connectionToClient); //} NetworkServer.SpawnObjects(); spawns = GameObject.FindGameObjectsWithTag("Respawn"); GameObject gmO = GameObject.FindGameObjectWithTag("GameController"); gm = gmO.GetComponent <GameMngr>(); if (teams) { Dictionary <int, List <Player> > teamPlayers = new Dictionary <int, List <Player> >(); foreach (Player p in players) { if (!teamPlayers.ContainsKey(p.team)) { teamPlayers.Add(p.team, new List <Player>() { p }); } else { teamPlayers[p.team].Add(p); } } List <GameObject> teamSpawns = new List <GameObject>(); int spawnNum = 0; List <GameObject> newSpawns = new List <GameObject>(); foreach (GameObject s in spawns) { teamSpawns.Add(s); } foreach (int team in teamPlayers.Keys) { int numPlayers = teamPlayers[team].Count; GameObject teamSpawn = teamSpawns[spawnNum]; spawnNum = (spawnNum + 1) % (teamSpawns.Count); for (int i = 0; i < numPlayers; i++) { GameObject s = Instantiate(spawnPre, teamSpawn.transform.position + teamSpawn.transform.forward * ((i + 1) / 2 * (Mathf.Pow(-1, i))) * 2 , teamSpawn.transform.rotation); newSpawns.Add(s); NetworkServer.Spawn(s); teamPlayers[team][i].spawnInd = newSpawns.Count - 1; } } spawns = newSpawns.ToArray(); foreach (GameObject s in teamSpawns) { Destroy(s); } foreach (Player p in players) { p.ghost.RpcInitilize(); } } else { int spawnNum = 0; foreach (Player p in players) { p.spawnInd = spawnNum; spawnNum = (spawnNum + 1) % (spawns.Length); p.ghost.RpcInitilize(); } } }