/// <summary> /// Start is called on the frame when a script is enabled just before /// any of the Update methods is called the first time. /// </summary> void Start() { player.im = this; car.im = this; joystickController = GetComponentInChildren <MobileJoystickController>(); if (transform.parent != null && transform.parent.name == "GameController") { GameObject gameController = transform.parent.gameObject; gcim = gameController.GetComponent <IInputManager>(); } }
// Start is called before the first frame update void Start() { _ARCamera = FindObjectOfType <Camera>().GetComponent <Camera>(); _joystickStatus = GameObject.Find("Joystick Status").GetComponent <Text>(); _currentVelocity = GameObject.Find("Velocity").GetComponent <Text>(); _rb = GetComponent <Rigidbody>(); //_CharController = GetComponent<CharacterController>(); _jsc = FindObjectOfType <MobileJoystickController>().GetComponent <MobileJoystickController>(); _target = GameObject.Find("CenterOfMass"); //FindObjectOfType<XbuttonController>().SetCharacterController(this.gameObject); FindObjectOfType <YbuttonController>().SetCharacterController(this.gameObject); startingY = this.transform.position.y; //_groundHeight = this.transform.position.y; //_maxJumpHeight = this.transform.position.y * 5; }
void Start() { //debugging stuff //_currentVelocity = GameObject.Find("Velocity").GetComponent<Text>(); //_joystickStatus = GameObject.Find("Joystick Status").GetComponent<Text>(); //_ARCText = GameObject.Find("PlayerARCText").GetComponent<Text>(); //_JSCText = GameObject.Find("PlayerJSC").GetComponent<Text>(); //actuall needed stuff _ARCamera = FindObjectOfType <Camera>().GetComponent <Camera>(); //_ARCText.text = "ARCam is: " + _ARCamera; //Debugging _rb = GetComponent <Rigidbody>(); _groundChecker = transform.GetChild(0); _gm = FindObjectOfType <GameManager>(); //_jsc = FindObjectOfType<MobileJoystickController>().GetComponent<MobileJoystickController>(); //Get Mobile Joystick (so we can move player) _jsc = FindObjectOfType <MobileJoystickController>().GetComponent <MobileJoystickController>(); //_JSCText.text = "JSC is: " + _jsc; //Debugging //Tell the buttons to control the player FindObjectOfType <YbuttonController>().SetPlayerController(this.gameObject); //FindObjectOfType<XbuttonController>().SetPlayerController(this.gameObject); //Tell enemies who spawn before player about the player FindObjectOfType <OldEnemyController>().SetPlayer(this.gameObject); //This code makes the game scalable //this.transform.localScale = new Vector3(_gm.GetArenaScale(), _gm.GetArenaScale(), _gm.GetArenaScale()) * 0.1f; //Speed *= _gm.GetArenaScale() * 0.1f; // JumpHeight *= _gm.GetArenaScale() * 0.1f; //_attackRange *= _gm.GetArenaScale() * 0.1f; _target = GameObject.FindGameObjectWithTag("Enemy"); //Set Max Health _maxHealth = _currentHealth; }
void Start() { _jsc = FindObjectOfType <MobileJoystickController>(); _rb = GetComponent <Rigidbody>(); _groundHeight = this.transform.position.y; }
void Start() { characterController = GetComponent <CharacterController>(); _jsc = FindObjectOfType <MobileJoystickController>().GetComponent <MobileJoystickController>(); }