void Start() { rb = GetComponent <Rigidbody2D>(); playerSprite = GetComponentInChildren <SpriteRenderer>(); playerGravity = FindObjectOfType <PlayerGravity>(); enemyScript = FindObjectOfType <Enemy>(); }
// Start is called before the first frame update void Start() { change = false; GameObject anotherObject = GameObject.Find("cat"); PG = anotherObject.GetComponent <PlayerGravity>(); }
private void Awake() { playerController = GetComponent <PlayerController>(); gravityScript = GetComponent <PlayerGravity>(); rb = GetComponent <Rigidbody>(); anim = GetComponent <Animator>(); }
void Start() { rb = GetComponent <Rigidbody2D>(); //playerSprite = GetComponentInChildren<SpriteRenderer>(); playerGravity = FindObjectOfType <PlayerGravity>(); defaultRunSpeed = playerSpeed; }
void Awake() { m_Rigidbody = GetComponent <Rigidbody>(); pg = GetComponent <PlayerGravity>(); m_Rigidbody.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY | RigidbodyConstraints.FreezeRotationZ; }
// Use this for initialization void Start() { rigid = GetComponent <Rigidbody> (); gravity = GetComponent <PlayerGravity> (); ui = GetComponent <UIControl> (); source = GetComponent <AudioSource> (); gamestate = GameState.PLAYING; }
// Use this for initialization void Start() { playerHiding = false; distaceFromWall = 0.0f; playerGravity = GetComponent<PlayerGravity> (); player = GetComponent<CharacterController> (); onStairs = false; playerHid = false; }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Player") { player = collision.GetComponent <PlayerGravity>(); player.AddGravity(gravityImpact); gameObject.SetActive(false); } }
private void Awake() { comboManager = GetComponentInParent <ComboManager>(); audioSource = GetComponent <AudioSource>(); gameOver = GetComponent <GameOver>(); death = GetComponentInParent <Death>(); horizontalMovement = GetComponent <HorizontalMovement>(); stateManager = GetComponentInParent <PlayerStateManager>(); playerGravity = GetComponent <PlayerGravity>(); }
void Awake() { instance = this; planet = GameObject.FindGameObjectWithTag("Planet").GetComponent <PlanetGravity>(); rb = GetComponent <Rigidbody> (); // Disable rigidbody gravity and rotation as this is simulated in GravityAttractor script rb.useGravity = false; rb.constraints = RigidbodyConstraints.FreezeRotation; }
void Start() { _camControl = FindObjectOfType <CameraControl>(); _inputHandler = FindObjectOfType <InputHandler>(); _playerManipulationArea = FindObjectOfType <PlayerManipulationArea>(); _playerAim = GetComponent <PlayerAim>(); _playerGravity = GetComponent <PlayerGravity>(); _playerAnimation = GetComponentInChildren <PlayerAnimation>(); ChangeSkillMode(); }
public PlayerController(PlayerParameter playerParameter, GameObject speedEffectObj = null) { parameter = playerParameter; playerMover = new PlayerMover(parameter.StartAccelSpeed); playerInput = new PlayerInput(); playerGravity = new PlayerGravity(); playerAnimator = new PlayerAnimator(); gameObject = PlayerObjectManager.Instance.PlayerObject; if (speedEffectObj != null) { speedEffectObject = speedEffectObj; } }
void Awake() { running = false; grounded = false; jetPackFuel = jetPackFuelMax; rb = GetComponent <Rigidbody2D>(); //coinSoundRef = GetComponent<CoinSound>(); inOrbit = false; playerGravity = planet.GetComponent <PlayerGravity>(); anim = GetComponent <Animator>(); weaponManager = GetComponent <WeaponManager>(); //groundCheckRadius = 1f; }
// Start is called before the first frame update void Start() { rigid2D = GetComponent <Rigidbody2D>(); starrender = gameObject.GetComponent <SpriteRenderer>(); //particle = GameObject.Find("Particle System"); //particle.SetActive(false); starrender.sprite = catsprite; mode = true;//trueは人間 falseは星 anim = GetComponent <Animator>(); audioManager = GetComponent <AudioManager>(); currentStar = startingStar; breakblock = GameObject.Find("BreakBlock"); playerGravity = gameObject.GetComponent <PlayerGravity>(); jumpCount = startJumpCount; }
// Use this for initialization private void Start() { m_CharacterController = GetComponent <CharacterController>(); m_Camera = Camera.main; m_OriginalCameraPosition = m_Camera.transform.localPosition; m_FovKick.Setup(m_Camera); m_HeadBob.Setup(m_Camera, m_StepInterval); m_StepCycle = 0f; m_NextStep = m_StepCycle / 2f; m_Jumping = false; gameOver = false; playerDied = false; m_AudioSource = GetComponent <AudioSource>(); mouseLook = GetComponentInChildren <MouseLook>(); //m_MouseLook.Init(transform , m_Camera.transform); g = GetComponent <PlayerGravity>(); oxygenScript = GetComponent <OxygenLevels>(); numKeycards = 0; }
private void Start() { _anim = GetComponent <Animator>(); _rb = GetComponentInParent <Rigidbody>(); _playerGravity = GetComponentInParent <PlayerGravity>(); _playerAim = GetComponentInParent <PlayerAim>(); _playerSkills = GetComponentInParent <PlayerSkills>(); _inputHandler = FindObjectOfType <InputHandler>(); // Layer index does not change so getting this once is enough. _aimLayer = _anim.GetLayerIndex("Aim"); _powerLayer = _anim.GetLayerIndex("Power"); // get head Transform[] bones = GetComponentsInChildren <Transform>(includeInactive: true); foreach (Transform child in bones) { if (child.name.Contains("PAA")) { _head = child; continue; } } }
public void Teleport(PlanetType _planetType) { TeleportScreen.SetActive(false); Time.timeScale = 1f; switch (_planetType) { case PlanetType.Grass: GrassBackground.SetActive(true); WaterBackground.SetActive(false); DesertBackground.SetActive(false); FireBackground.SetActive(false); GrassBits.SetActive(true); WaterBits.SetActive(false); DesertBits.SetActive(false); FireBits.SetActive(false); GrassPlanet.gameObject.tag = "Planet"; WaterPlanet.gameObject.tag = "Untagged"; DesertPlanet.gameObject.tag = "Untagged"; FirePlanet.gameObject.tag = "Untagged"; //yield return new WaitForSeconds(0.5f); PlayerGravity.UpdatePlanetGravity(); PlayerController360.planetGravity = GameObject.FindGameObjectWithTag("Planet").GetComponent <PlanetGravity>(); player.GetComponent <Rigidbody>().velocity = player.GetComponent <Rigidbody>().angularVelocity = Vector3.zero; player.transform.position = GrassPlayerSpawnPosition; player.transform.eulerAngles = GrassPlayerSpawnEulerAngles; break; case PlanetType.Water: GrassBackground.SetActive(false); WaterBackground.SetActive(true); DesertBackground.SetActive(false); FireBackground.SetActive(false); GrassBits.SetActive(false); WaterBits.SetActive(true); DesertBits.SetActive(false); FireBits.SetActive(false); GrassPlanet.gameObject.tag = "Untagged"; WaterPlanet.gameObject.tag = "Planet"; DesertPlanet.gameObject.tag = "Untagged"; FirePlanet.gameObject.tag = "Untagged"; //yield return new WaitForSeconds(0.5f); PlayerGravity.UpdatePlanetGravity(); PlayerController360.planetGravity = GameObject.FindGameObjectWithTag("Planet").GetComponent <PlanetGravity>(); player.GetComponent <Rigidbody>().velocity = player.GetComponent <Rigidbody>().angularVelocity = Vector3.zero; player.transform.position = WaterPlayerSpawnPosition; player.transform.eulerAngles = WaterPlayerSpawnEulerAngles; break; case PlanetType.Desert: GrassBackground.SetActive(false); WaterBackground.SetActive(false); DesertBackground.SetActive(true); FireBackground.SetActive(false); GrassBits.SetActive(false); WaterBits.SetActive(false); DesertBits.SetActive(true); FireBits.SetActive(false); GrassPlanet.gameObject.tag = "Untagged"; WaterPlanet.gameObject.tag = "Untagged"; DesertPlanet.gameObject.tag = "Planet"; FirePlanet.gameObject.tag = "Untagged"; //yield return new WaitForSeconds(0.5f); PlayerGravity.UpdatePlanetGravity(); PlayerController360.planetGravity = GameObject.FindGameObjectWithTag("Planet").GetComponent <PlanetGravity>(); player.GetComponent <Rigidbody>().velocity = player.GetComponent <Rigidbody>().angularVelocity = Vector3.zero; player.transform.position = DesertPlayerSpawnPosition; player.transform.eulerAngles = DesertPlayerSpawnEulerAngles; break; case PlanetType.Fire: GrassBackground.SetActive(false); WaterBackground.SetActive(false); DesertBackground.SetActive(false); FireBackground.SetActive(true); GrassBits.SetActive(false); WaterBits.SetActive(false); DesertBits.SetActive(false); FireBits.SetActive(true); GrassPlanet.gameObject.tag = "Untagged"; WaterPlanet.gameObject.tag = "Untagged"; DesertPlanet.gameObject.tag = "Untagged"; FirePlanet.gameObject.tag = "Planet"; //yield return new WaitForSeconds(0.5f); PlayerGravity.UpdatePlanetGravity(); PlayerController360.planetGravity = GameObject.FindGameObjectWithTag("Planet").GetComponent <PlanetGravity>(); player.GetComponent <Rigidbody>().velocity = player.GetComponent <Rigidbody>().angularVelocity = Vector3.zero; player.transform.position = FirePlayerSpawnPosition; player.transform.eulerAngles = FirePlayerSpawnEulerAngles; break; default: break; } }
void Start() { playerGravity = FindObjectOfType <PlayerGravity>(); countdown = playerGravity.GravityTimer + .5f; }
void Awake() { playerController = GetComponent <PlayerController>(); gravityScript = GetComponent <PlayerGravity>(); anim = GetComponent <Animator>(); }
private void Start() { objects = new List <AirCurrentObj>(); pGrav = GameObject.Find("Player3").GetComponent <PlayerGravity>(); pauseMenu = GameObject.Find("UI").GetComponent <PauseMenu>(); }
// Use this for initialization void Start() { player = GetComponent<CharacterController> (); gravity = GetComponent<PlayerGravity> (); playerMove = GetComponent<PlayerMove> (); timer = 0; timerRunning = false; knockback = Vector3.zero; addingKnockback = false; knowbackTimer = 0; }
// Use this for initialization void Awake() { planet = GameObject.FindGameObjectWithTag("Planet"); localGravity = planet.GetComponent <PlayerGravity>(); }
// Start is called before the first frame update void Start() { CGravity = false; PG = GetComponent <PlayerGravity>(); }