// Start is called before the first frame update void Start() { rbody = GetComponent <Rigidbody>(); mGroundCheck = GetComponent <GroundedCheck>(); groundCollider = GetComponent <Collider>(); mTrajectory = GetComponent <DrawLine>(); }
void Awake() { core = Core.instance; core.SetPlayer(transform); playerInput = PlayerInput.instance; player = ReInput.players.GetPlayer(playerID); characterController = GetComponent <CharacterController>(); rb = GetComponent <Rigidbody>(); turn = new Turn(this); faceTarget = new FaceTarget(this, inputLibrary.Left_Shoulder); move = new Move(this); strafing = new Strafing(this, inputLibrary.Left_Trigger); customGravity = new CustomGravity(this); groundedCheck = new GroundedCheck(this); edgeCheck = new EdgeCheck(this); jump = new Jump(this, inputLibrary.A); dash = new Dash(this, inputLibrary.Right_Shoulder); attackFast = new Attack(this, inputLibrary.X, playerProfile.attack); attackHeavy = new Attack(this, inputLibrary.Y, playerProfile.attackHeavy); attackFeint = new Attack(this, inputLibrary.B, playerProfile.attackFeint); // AnimationControl should be instantiated last to enable // connections to former components //animationControl = new AnimationControl(this, move); }
void Start() { rb2d = GetComponent <Rigidbody2D>(); gc = groundedCheck.GetComponent <GroundedCheck>(); sr = GetComponent <SpriteRenderer>(); anim = GetComponent <Animator>(); livesCounterText = livesCounter.GetComponent <Text>(); scoreText = scoreValueObj.GetComponent <Text>(); transform.position = new Vector2(gameStartSpawn.transform.position.x, gameStartSpawn.transform.position.y); }
private void Awake() { f_B = FindObjectOfType <FallBackChecking>(); f_T = FindObjectOfType <FallTowardChecking>(); groundCheck = FindObjectOfType <GroundedCheck>(); }
protected virtual void Awake() { _collider2D = GetComponent<Collider2D>(); if (!audioSource) { audioSource = GetComponentInChildren<AudioSource>(); } if (!animator) { animator = GetComponentInChildren<Animator>(); } maxHealth = health; _damageColor = Color.red; groundedCheck = GetComponentInChildren<GroundedCheck>(); }