void Awake() { rigidbody.freezeRotation = true; rigidbody.useGravity = false; player = GetComponent<playerCharacter> (); controllerInput = GetComponent<XboxControls>(); animator = GetComponentInChildren<Animator> (); trailEffect = transform.FindChild("dashTrail").gameObject; }
void Awake() { manager = GameObject.FindGameObjectWithTag ("GameController").GetComponent<gameController>(); controllerInput = GetComponent<XboxControls> (); Box = GetComponentInChildren<hitBox>(); Slam = GetComponentInChildren<slam> (); manager.players.Add (this); animator = GetComponentInChildren<Animator> (); spinning = GetComponentInChildren<fastHammerPhysics> (); rigidBody = GetComponent<RigidBodyControls> (); gravityValue = rigidBody.gravity; if (manager.settings != null) { lives = manager.settings.lives; } healthMax = health; stunParticles = transform.FindChild ("stun").gameObject; manager.alivePlayers.Add (this); soundEffect = GetComponent<playerSFX> (); myAudio = GetComponent<AudioSource> (); }
private MatchOptions settings; // Referance to level options which get passed to next scene #endregion Fields #region Methods // Use this for initialization void Start() { controller = GetComponent<XboxControls>(); settings = GameObject.FindGameObjectWithTag("Settings").GetComponent<MatchOptions>(); controller.controllerInUse = settings.playerCount - 1; }