void UpdateCharacterState() { if ((Input.GetButtonDown("Fire1") == true) && (standByCharacters.Count > 0)) { foreach (ThirdPersonUserControl controller in standByCharacters) { activeCharacters.Add(controller); controller.state = ThirdPersonUserControl.State.Active; controller.characterController.indicator = ThirdPersonCharacter.Indicator.Active; } standByCharacters.Clear(); } else if ((Input.GetButtonDown("Fire2")) && (activeCharacters.Count > 1)) { ThirdPersonUserControl currentController = activeCharacters[controlledIndex]; foreach (ThirdPersonUserControl controller in activeCharacters) { if (controller != currentController) { controller.state = ThirdPersonUserControl.State.Standby; controller.characterController.indicator = ThirdPersonCharacter.Indicator.Standby; } } activeCharacters.Clear(); activeCharacters.Add(currentController); controlledIndex = 0; } }
// Use this for initialization void Start() { GameManager.player = this.GetComponent <PlayerControl>(); movement = this.GetComponent <ThirdPersonUserControl>(); codes = new List <int>(); currentLife = maxLife; }
// Use this for initialization public void StartATL(ThirdPersonUserControl player, CurvySpline spline) { /* * calling hull functions doesn't work * print ("start in ConcaveHullController called"); * foreach (Transform child in transform) * { * //can set vetices here * ConcaveCollider newCollider = child.gameObject.AddComponent<ConcaveCollider>(); * newCollider.MaxHullVertices = maxHullVerts; * newCollider.MaxHulls = maxHulls; * newCollider.Precision = precision; * newCollider.ForceNoMultithreading = true; * newCollider.ComputeHulls (null, null); * //child.GetComponent<ConcaveCollider> ().ComputeHulls (null, null); * Destroy(child.transform.GetChild(0).gameObject); * child.gameObject.AddComponent<MakeMesh> (); * //print ("largest hull verts = " + child.GetComponent<ConcaveCollider> ().GetLargestHullVertices ()); * } */ foreach (Transform child in transform) { _childMeshes.Add(child.gameObject); } }
// Use this for initialization void Start() { if (id == 1) { dir [0] = -1; dir [1] = 0; } else { dir [0] = 1; dir [1] = 0; } personControl = GetComponent <ThirdPersonUserControl> (); personControl.setOnRunFinished(() => { ensureIsOnBoard(); GameManager.Instance.changeTurn(); }); GameManager.Instance.setOnPlayerChangeListener(id, () => { int[] dim = defaultBlock(); TileManager.Instance.selectBlock(dim[0], dim[1]); }); GameManager.Instance.setOnLoseListener(id, () => { TileManager.Instance.disappear(current_x, current_y); }); }
// Start is called before the first frame update void Start() { subject = GameObject.FindGameObjectWithTag("Player"); code = GameManager.instance; control = subject.GetComponent <ThirdPersonUserControl>(); anim = subject.GetComponent <Animator>(); }
void Awake() { userControl = GetComponentInChildren <ThirdPersonUserControl>(); animator = GetComponentInChildren <Animator>(); topRB = GetComponentInParent <Rigidbody>(); }
// Use this for initialization void Start() { if (FlyCamera == null || ThirdPersonCamera == null) { Debug.Log("No Camera found"); return;; } _flyControl = FlyCamera.GetComponent<FlyCam>(); if (_flyControl == null) { Debug.Log("No FlyCam script found on FlyCamera Gameobject"); return; } _flyControl.isActive = true; FlyCamera.enabled = true; _thirdPersonControl = GameObject.FindWithTag("Player").GetComponent<ThirdPersonUserControl>(); if (_thirdPersonControl == null) { Debug.Log("No ThirdPersonControl script found on ThirdPersonCamera Gameobject"); return; } _thirdPersonControl.isActive = false; ThirdPersonCamera.enabled = false; }
// Use this for initialization void Start() { //Isgameover = GameObject.FindGameObjectWithTag("plane").GetComponent<GameOver>(); win = false; ThirdPersonUserControl_blue = GameObject.FindGameObjectWithTag("blue").GetComponent<UnitySampleAssets.Characters.ThirdPerson.ThirdPersonUserControl>(); ThirdPersonUserControl_red = GameObject.FindGameObjectWithTag("red").GetComponent<UnitySampleAssets.Characters.ThirdPerson.ThirdPersonUserControl>(); ThirdPersonUserControl_green = GameObject.FindGameObjectWithTag("green").GetComponent<UnitySampleAssets.Characters.ThirdPerson.ThirdPersonUserControl>(); cameraController_camera = GameObject.Find("worldCenter").GetComponent<cameraController_camera>(); }
void Start() { player_RigidBody = GetComponent <Rigidbody>(); freezePositon(); AssignToCamera(); //get the ThirdPersonCharacter script component. tpControl = GetComponent <ThirdPersonUserControl>(); tpc = GetComponent <ThirdPersonCharacter>(); }
// Update is called once per frame public void UpdateATL(ThirdPersonUserControl player_three, Crosshair crosshair, CurvySpline spline) { kickBackTime = Mathf.Clamp01(kickBackTime + Time.deltaTime * 2.0f); transform.localEulerAngles = new Vector3(kickBackCurve.Evaluate(kickBackTime) * -70, transform.localEulerAngles.y, transform.localEulerAngles.z); for (int i = 0; i < _missiles.Count; i++) { _missiles [i].UpdateATL(player_three, crosshair, spline); } }
// Update is called once per frame public void UpdateATL(ThirdPersonUserControl _playerController_three) { // CurvySpline spline = splineLord_three.GetSpline (); // // t = spline.GetNearestPointTF( _playerController_three.transform.position ); // // transform.position = spline.Interpolate ( t - spline.Length / 100.0f ); transform.position = _playerController_three.transform.position - 15.0f * transform.forward + _lift; //transform.rotation = Quaternion.Slerp( transform.rotation, spline.GetOrientationFast( t ), Time.deltaTime * 5.0f ); }
// Use this for initialization void Start() { winCanvas.enabled = false; win_mainmenu.enabled = false; Animacamera = GameObject.Find("AnimCamera_over"); Debug.Log(Animacamera); anim = Animacamera.GetComponent<Animator>(); ThirdPersonUserControl_blue = GameObject.FindGameObjectWithTag("blue").GetComponent<UnitySampleAssets.Characters.ThirdPerson.ThirdPersonUserControl>(); ThirdPersonUserControl_red = GameObject.FindGameObjectWithTag("red").GetComponent<UnitySampleAssets.Characters.ThirdPerson.ThirdPersonUserControl>(); ThirdPersonUserControl_green = GameObject.FindGameObjectWithTag("green").GetComponent<UnitySampleAssets.Characters.ThirdPerson.ThirdPersonUserControl>(); Animacamera.SetActive(false); }
void Start() { carScript = car.GetComponent<CarMovement>(); helicopterScript = helicopter.GetComponent<HelicopterScript> (); playerScript = player.GetComponent<ThirdPersonUserControl> (); cameraCarScript = mainCamera.GetComponent<CameraCarScript> (); cameraPlayerScript = mainCamera.GetComponent<CameraPlayerScript> (); cameraHelicopterScript = mainCamera.GetComponent<CameraHelicopterScript> (); player.transform.GetChild (0).GetChild(0).renderer.enabled = false; player.transform.GetChild (0).GetChild(1).renderer.enabled = false; }
/*void switchToPlayer(inputToEnable, inputToDisable, cameraLocation) { inputToEnable.enabled = true; inputToDisable.enabled = false; defaultCamera.transform.position = cameraLocation.transform.position; defaultCamera.transform.rotation = cameraLocation.transform.rotation;}*/ // Use this for initialization void Start() { ragsUserControl = GameManager.god.ragsObject.GetComponent<ThirdPersonUserControl>(); ragsAIControl = GameManager.god.ragsObject.GetComponent<AICharacterControl>(); reasonUserControl = GameManager.god.reasonObject.GetComponent<BallUserControl>(); reasonToRags = GameManager.god.reasonObject.GetComponent<FollowRags>(); ragsPlayerCam = GameManager.god.ragsCam; reasonPlayerCam = GameManager.god.reasonCam; //ragsUserControl.enabled = playerRagsActive; //reasonUserControl.enabled = playerReasonActive; //ragsPlayerCam.enabled = playerRagsActive; //reasonPlayerCam.enabled = playerReasonActive; //player1Input = player1.GetComponent("(your controller)"); //player2Input = player2.GetComponent("(your controller)"); }
// Use this for initialization void Start() { targetAnimator.GetBehaviour<StateSoundBehaviour>().soundBank = targetAnimator.GetComponent<SoundBank>(); radiusOfInteraction = GetComponent<Collider>().bounds.extents.x; thirdCharacter = GetComponent<ThirdPersonCharacter>(); userControl = GetComponent<ThirdPersonUserControl>(); animationRootOrigin = animationRoot.localPosition; animationRootOriginRot = animationRoot.localRotation; characterCollider = GetComponent<Collider>(); characterRigidbody = GetComponent<Rigidbody>(); start_rejuvination_time = rejuvination_time; start_flash_time = flash_time; fatigue_pool_start = fatigue_pool; mats[0] = Resources.Load<Material>("mainbody"); mats[1] = Resources.Load<Material>("greenarms"); mats[2] = Resources.Load<Material>("greencore"); mats[3] = Resources.Load<Material>("greenlegs"); mats[4] = Resources.Load<Material>("yellowarms"); mats[5] = Resources.Load<Material>("yellowcore"); mats[6] = Resources.Load<Material>("yellowlegs"); mats[7] = Resources.Load<Material>("redarms"); mats[8] = Resources.Load<Material>("redcore"); mats[9] = Resources.Load<Material>("redlegs"); skin = transform.FindChild("Mesh").transform.FindChild("anubis").transform.FindChild("polySurface63").GetComponent<SkinnedMeshRenderer>(); }