private void OnTriggerStay(Collider other) { if (other.gameObject.tag == "Robot") //if it is robot { botc = other.gameObject.GetComponent <RobotControl>(); if (Input.GetButtonDown("Jump") || btcon.space) { if (botc.used == false && !onBot) { if (other.gameObject.tag == "Robot") { botgo = other.gameObject; //botrb = other.attachedRigidbody; CmdGetControl(botgo); changingBot(); timer = 0; rememberPos = body.position - other.transform.position; StartCoroutine(fade()); } } } else if (Input.GetButtonDown("Jump") && botc.used == true) { Debug.Log("The robot is in used!!"); } } }
// Use this for initialization void Start() { // robotControl = FindObjectOfType <RobotControl>(); previousShovelPosture = ShovelPostures.Original; currentShovelPosture = ShovelPostures.Original; // shovels = new Transform[shovelParent.childCount]; shovelsPositions = new List <Transform[]>(); // //if(sh) // shovelsPositions = new List <Transform[]>(shovelPositionsParents.Length); for (int i = 0; i < shovelPositionsParents.Length; i++) { shovelsPositions.Add(new Transform[4]); } // for (int i = 0; i < shovelParent.childCount; i++) { shovels[i] = shovelParent.GetChild(i); for (int j = 0; j < shovelPositionsParents.Length; j++) { // Chequeo para que no de error en cinemáticas if (shovelPositionsParents[j] != null) { shovelsPositions[j][i] = shovelPositionsParents[j].GetChild(i); } } } }
private async void MoveForwardButton_Pressed(object sender, EventArgs e) { if (AutoSwitch.IsToggled) { AutoSwitch.IsToggled = false; } try { await Task.Run(() => { while (MoveForwardButton.IsPressed && speed < 10) { _control.Move(allowMoving: true, forward: true, speed: speed); speed++; Thread.Sleep(150); } }); } catch (Exception) { await Navigation.PopModalAsync(); CrossToastPopUp.Current.ShowToastMessage("Lost Connection"); _connection = null; _control = null; } }
public ActionResult RobotDown(Dictionary <string, string> queryvalues) { int gametype = queryvalues.ContainsKey("gametype") ? Convert.ToInt32(queryvalues["gametype"]) : 0; int downtype = queryvalues.ContainsKey("downtype") ? Convert.ToInt32(queryvalues["downtype"]) : 0; RobotControl robotCon = new RobotControl(); ModifyRobotConfig ModifyRobotConfig; ModifyRobotConfig = ModifyRobotConfig.CreateBuilder() .SetGameType((uint)gametype) .SetIsBet((uint)downtype) .Build(); Bind tbind = Cmd.runClientRobot(new Bind(ServiceCmd.SC_ROBOT_MODIFY, ModifyRobotConfig.ToByteArray()), 12001); switch ((CenterCmd)tbind.header.CommandID) { case CenterCmd.CS_ROBOT_STATU: //RobotStatus robotStatus = RobotStatus.ParseFrom(tbind.body.ToBytes()); return(Json(new { res = 1, Data = "", down = (downtype) })); } return(Json(new { res = 0, Data = "", down = (downtype == 1 ? 0 : 1) })); }
void Awake() { robot = mainPlayer.GetComponent <RobotControl>(); // cnvParameters.SetActive(true); // mainPlayer.SetActive(false); // cnvGame.SetActive(false); cnvLevel.SetActive(false); playerChoose.SetActive(false); btnNext.SetActive(false); // GalaxySphere.SetActive(false); // Dust.SetActive(false); // for (int i = 0; i < btnLevels.Length; i++) // { // btnLevels[i].SetActive(false); // } // for (int i = 0; i < panelParameters.Length; i++) // { // panelParameters[i].SetActive(false); // } // txtParameters.SetActive(true); // txtParameters.GetComponent<Text>().text = "Cargando..."; sldCharge.GetComponent <Slider>().value = 0f; sldCharge.GetComponent <Slider>().maxValue = 100f; isParameter = true; rb = playerChoose.GetComponent <Rigidbody>(); //parametros nivel 01 // meteorCount.text = "200"; // spawnWait.text = "0.04"; // speedMeteor.text = "-20"; // countDown.text = "60"; }
// Start is called before the first frame update void Start() { player = FindObjectOfType <RobotControl>(); if (player != null) { playerRB = player.GetComponent <Rigidbody>(); } // shootPoint = transform.Find("Shoot Point"); if (shootPoint == null) { shootPoint = transform.Find("Barrel/Shoot Point"); } // originalRotation = transform.localRotation; // audioSource = GetComponent <AudioSource>(); // bodyRb = GetComponentInParent <Rigidbody>(); // Registramos las correspondientes balas en el pool bulletPool = FindObjectOfType <BulletPool>(); Bullet bulletData = proyectilePrefab.GetComponent <Bullet>(); bulletPool.RegisterBullets(proyectilePrefab, rateOfFire, bulletData.lifeTime); }
// Start is called before the first frame update void Start() { player = FindObjectOfType <RobotControl>(); if (player != null) { playerRB = player.GetComponent <Rigidbody>(); } }
void Start() { mGameManager = FindObjectOfType <GameManager>(); mInputManager = FindObjectOfType <InputManager>(); mRobotControl = FindObjectOfType <RobotControl>(); InitializeCrosshair(); }
public static void Initiate(GameObject playerGO) { playerTransform = playerGO.transform; playerRb = playerGO.GetComponent <Rigidbody>(); playerIntegrity = playerGO.GetComponent <PlayerIntegrity>(); playerControl = playerGO.GetComponent <RobotControl>(); isAlive = true; }
// Start is called before the first frame update protected virtual void Start() { player = FindObjectOfType <RobotControl>(); rb = GetComponent <Rigidbody>(); bodyConsistency = GetComponent <EnemyConsistency>(); terrainManager = FindObjectOfType <TerrainManager>(); audioSource = GetComponent <AudioSource>(); enemyManager = FindObjectOfType <EnemyManager>(); }
private void Start() { robotScript = robot.GetComponent <RobotControl>(); GetComponent <VRTK_ControllerEvents>().TriggerAxisChanged += new ControllerInteractionEventHandler(DoTriggerAxisChanged); GetComponent <VRTK_ControllerEvents>().TouchpadAxisChanged += new ControllerInteractionEventHandler(DoTouchpadAxisChanged); GetComponent <VRTK_ControllerEvents>().TriggerReleased += new ControllerInteractionEventHandler(DoTriggerReleased); GetComponent <VRTK_ControllerEvents>().TouchpadTouchEnd += new ControllerInteractionEventHandler(DoTouchpadTouchEnd); //GetComponent<VRTK_ControllerEvents>().ApplicationMenuPressed += new ControllerInteractionEventHandler(DoApplicationMenuPressed); }
// Use this for initialization void Start() { //previousMousePosition = Input.mousePosition; cameraControl = FindObjectOfType <SpringCamera>(); inputManager = FindObjectOfType <InputManager>(); playerControl = FindObjectOfType <RobotControl>(); // transitionProgression = transitionTimeBetweenEnemies; }
// Aqui trabajaremos la salida del ojete private void OnTriggerEnter(Collider other) { // RobotControl possiblePlayer = other.GetComponent <RobotControl>(); if (possiblePlayer != null) { ShitPlayer(); } }
// Use this for initialization void Start() { impactInfoList = new List <ImpactInfo>(100); // robotControl = FindObjectOfType <RobotControl>(); // Iniciamos el de rapid fire rapidFireImpactInfo = new ImpactInfo(); rapidFireImpactInfo.info = 0 + ""; // mainCamera = Camera.main; }
// Start is called before the first frame update void Start() { robotControl = GetComponent <RobotControl>(); gameManager = FindObjectOfType <GameManager>(); bodyRB = GetComponent <Rigidbody>(); hud = FindObjectOfType <ProvisionalHUD>(); audioSource = GetComponent <AudioSource>(); levelManager = FindObjectOfType <ProvLevelManager>(); carolHelp = FindObjectOfType <CarolBaseHelp>(); // currentHealth = gameManager.playerAttributes.maxHealth; currentShield = gameManager.playerAttributes.maxShield.CurrentValue; }
// Start is called before the first frame update protected virtual void Start() { audioSource = GetComponent <AudioSource>(); audioObjectManager = FindObjectOfType <AudioObjectManager>(); gameManager = FindObjectOfType <GameManager>(); player = FindObjectOfType <RobotControl>(); inputManager = FindObjectOfType <InputManager>(); // Le damos al primer clip if (carolStepObjects.Length > 0) { PlayClip(CurrentStep.audioClip); } }
// Start is called before the first frame update protected virtual void Start() { player = FindObjectOfType <RobotControl>(); audioSource = GetComponent <AudioSource>(); levelManager = FindObjectOfType <ProvLevelManager>(); carolHelp = FindObjectOfType <CarolBaseHelp>(); cameraReference = FindObjectOfType <CameraReference>(); enemyManager = FindObjectOfType <EnemyManager>(); // if (carolStepObjects.Length > 0) { carolHelp.SetStepObjects(carolStepObjects); } }
static void SelectContainer(Selectable s) { //Debug.Log("Container '" + s.name + "' was selected!"); if (null != selectedRobot) { Waypoint wp = s.GetComponent <Waypoint>(); if (null == wp) { Debug.LogError("Missing <Waypoint> on " + s.name); } selectedRobot.SetTarget(wp); selectedRobot.UnhighlightRobot(); selectedRobot = null; } }
private async void ResetButton_Clicked(object sender, EventArgs e) { try { _control.SetDefaultConfigrations(); } catch (Exception) { await Navigation.PopModalAsync(); CrossToastPopUp.Current.ShowToastMessage("Lost Connection"); _view = null; _control = null; } }
bool PlayerOnSight() { RaycastHit hitInfo; Vector3 playerDirection = player.transform.position - shootPoint.transform.position; if (Physics.Raycast(shootPoint.transform.position, playerDirection, out hitInfo, playerDirection.magnitude)) { RobotControl robotControl = hitInfo.transform.GetComponent <RobotControl>(); if (robotControl != null) { return(true); } } return(false); }
// Use this for initialization void Start() { rb = GetComponent <Rigidbody>(); //dustEmitterStatic.SetActive(true); currentParticleSystem = dustEmitterStatic; inputManager = FindObjectOfType <InputManager>(); gameManager = FindObjectOfType <GameManager>(); robotControl = GetComponent <RobotControl>(); audioSource = GetComponent <AudioSource>(); playerIntegrity = GetComponent <PlayerIntegrity>(); // StopDustEmitterParticleSystem(dustEmitterMovement); // transform.position = Vector3.up * idealDistanceFromFloor; }
public ActionResult RobotUpdateLimit(Dictionary <string, string> queryvalues) { int gametype = queryvalues.ContainsKey("gametype") ? Convert.ToInt32(queryvalues["gametype"]) : 0; int limit0 = queryvalues.ContainsKey("limit0") ? Convert.ToInt32(queryvalues["limit0"]) : 0; int limit1 = queryvalues.ContainsKey("limit1") ? Convert.ToInt32(queryvalues["limit1"]) : 0; int limit2 = queryvalues.ContainsKey("limit2") ? Convert.ToInt32(queryvalues["limit2"]) : 0; int limit3 = queryvalues.ContainsKey("limit3") ? Convert.ToInt32(queryvalues["limit3"]) : 0; int limit4 = queryvalues.ContainsKey("limit4") ? Convert.ToInt32(queryvalues["limit4"]) : 0; RobotControl robotCon = new RobotControl(); ModifyRobotConfig ModifyRobotConfig; ModifyRobotConfig = ModifyRobotConfig.CreateBuilder() .SetGameType((uint)gametype) .AddLimit((uint)limit0) .AddLimit((uint)limit1) .AddLimit((uint)limit2) .AddLimit((uint)limit3) .AddLimit((uint)limit4) .Build(); Bind tbind = Cmd.runClientRobot(new Bind(ServiceCmd.SC_ROBOT_MODIFY, ModifyRobotConfig.ToByteArray()), 12001); switch ((CenterCmd)tbind.header.CommandID) { case CenterCmd.CS_ROBOT_STATU: RobotStatus RobotStatus = RobotStatus.ParseFrom(tbind.body.ToBytes()); IList <GameStatu> gameStatuList = RobotStatus.GameStatuList; GameStatu game = gameStatuList.FirstOrDefault(m => m.GameType == gametype); string limits = ""; for (int i = 0; i < game.PlayerLimitList.Count(); i++) { limits += game.PlayerLimitList[i] + ","; } limits = limits.Trim(','); return(Json(new { res = 1, Data = limits })); } return(Json(new { res = 0, Data = "" })); }
private async void TurnLeftButton_Pressed(object sender, EventArgs e) { try { _control.Turn(false, _control.MaxTurnLeft); } catch (Exception) { await Navigation.PopModalAsync(); CrossToastPopUp.Current.ShowToastMessage("Lost Connection"); _connection.Disconect(); _connection = null; _control = null; } }
private async void AutoSwitch_Toggled(object sender, ToggledEventArgs e) { try { _control.AutomaticMode(AutoSwitch.IsToggled); } catch (Exception) { await Navigation.PopModalAsync(); CrossToastPopUp.Current.ShowToastMessage("Lost Connection"); _connection.Disconect(); _connection = null; _control = null; } }
public ControlView() { InitializeComponent(); if (_connection == null) { try { _connection = DeviceConnection.GetConnection(); _control = new RobotControl(_connection); } catch (Exception) { CrossToastPopUp.Current.ShowToastMessage("You are not connected to any device"); } } }
// Start is called before the first frame update void Start() { // robotControl = FindObjectOfType <RobotControl>(); gameManager = FindObjectOfType <GameManager>(); enemyManager = GetComponent <EnemyManager>(); terrainManager = GetComponent <TerrainManager>(); fade = FindObjectOfType <Fade>(); inputManager = FindObjectOfType <InputManager>(); // In arcade mode we get the data from level info list //if(gameManager.gameMode == GameMode.Arcade) LoadLevelDataArcade(); // In boss mode... /*else * { * * }*/ // //switch (victoryCondition) //{ // case VictoryCondition.DefeatAllEnemies: // EnemyConsistency[] enemiesInLevel = FindObjectsOfType<EnemyConsistency>(); // enemiesToDestroy = enemiesInLevel.Length; // break; //} // if (victoryCondition == VictoryCondition.DefeatCertainEnemy) { EnemyConsistency enemyConsistency = levelInfo.enemiesSpawnSettings[0].enemyPrefab.GetComponent <EnemyConsistency>(); if (enemyConsistency == null) { enemyConsistency = levelInfo.enemiesSpawnSettings[0].enemyPrefab.GetComponentInChildren <EnemyConsistency>(); } enemyToKillName = enemyConsistency.inGameName; } // Escodemos el cursor para jugar birn Cursor.lockState = CursorLockMode.Locked; Cursor.visible = false; }
public ActionResult RobotLogon(Dictionary <string, string> queryvalues) { int gametype = queryvalues.ContainsKey("gametype") ? Convert.ToInt32(queryvalues["gametype"]) : -1; int openmodule = queryvalues.ContainsKey("openmodule") ? Convert.ToInt32(queryvalues["openmodule"]) : -1; int second = queryvalues.ContainsKey("second") ? Convert.ToInt32(queryvalues["second"]) : 0; int num = queryvalues.ContainsKey("num") ? Convert.ToInt32(queryvalues["num"]) : 0; RobotControl robotCon = new RobotControl(); LoginRequest LoginRequest; LoginRequest = LoginRequest.CreateBuilder() .SetGameType((uint)gametype) .SetLoginFrequency((uint)second) .SetLoginCnt(num) .SetStrategy((uint)openmodule) .Build(); Bind tbind = Cmd.runClientRobot(new Bind(ServiceCmd.SC_ROBOT_LOGIN, LoginRequest.ToByteArray()), 12001); switch ((CenterCmd)tbind.header.CommandID) { case CenterCmd.CS_ROBOT_STATU: return(Json(new { res = 1, Data = "" })); case CenterCmd.C2S_ROBOT_ERRMSG: ErrorMessage ErrorMessage = ErrorMessage.ParseFrom(tbind.body.ToBytes()); return(Json(new { res = 0, Data = ErrorMessage.ErrorMessage_ })); } return(Json(new { res = 0, Data = "" })); }
// Use this for initialization void Start() { robotControl = FindObjectOfType <RobotControl>(); mainCamera = Camera.main; impactInfoManager = FindObjectOfType <ImpactInfoManager>(); //cameraControl = mainCamera.GetComponent<SpringCamera>(); cameraControl = FindObjectOfType <SpringCamera>(); gameManager = FindObjectOfType <GameManager>(); playerIntegrity = FindObjectOfType <PlayerIntegrity>(); levelManager = FindObjectOfType <ProvLevelManager>(); enemyManager = FindObjectOfType <EnemyManager>(); bulletPool = FindObjectOfType <BulletPool>(); // damageIndicators = new List <DamageIndicator>(20); // radarDimensions = new Vector2(Screen.height * radarProportion, Screen.height * radarProportion); }
// Start is called before the first frame update void Start() { gigaWormBehaviour = FindObjectOfType <GigaWormBehaviour>(); player = FindObjectOfType <RobotControl>(); playerRb = PlayerReference.playerRb; // asEmissionControl = new ParticleSystem.EmissionModule[acidShowers.Length]; asMainControl = new ParticleSystem.MainModule[acidShowers.Length]; asInitialEmission = new float[acidShowers.Length]; asInitialSpeed = new float[acidShowers.Length]; for (int i = 0; i < asEmissionControl.Length; i++) { asEmissionControl[i] = acidShowers[i].emission; asMainControl[i] = acidShowers[i].main; asInitialEmission[i] = asEmissionControl[i].rateOverTime.constant; asInitialSpeed[i] = asMainControl[i].startSpeed.constant; } }
private async void OnSetForwardPosition(object sender, EventArgs e) { try { _control.ToDirectPosition(); if (AutoSwitch.IsToggled) { AutoSwitch.IsToggled = false; } } catch (Exception) { await Navigation.PopModalAsync(); CrossToastPopUp.Current.ShowToastMessage("Lost Connection"); _connection = null; _control = null; } }