void Start() { rb = GetComponent <Rigidbody2D>(); state = GetComponent <Player_State>(); animator = GetComponent <Player_Animator>(); timers = GetComponent <Player_Timers>(); attributes = state.attributes; wallActions = GetComponent <Player_Wall_Actions>(); pJump = GetComponent <Player_Jump>(); pDash = GetComponent <Player_Dash>(); pDive = GetComponent <Player_Dive>(); pCol = GetComponent <Player_Collisions>(); pAttack = GetComponent <Player_Attack>(); move = GetComponent <Player_Move>(); playerManager = GetComponent <PlayerManager>(); rb.drag = 0.5f; rb.mass = 1.5f; ReceiveValues(); moveSpeed = attributes.moveSpeed; jumpVelocity = attributes.jumpVelocity; maxDescendAngle = attributes.maxDescendAngle; dashSpeed = attributes.dashSpeed; momentumFactor = attributes.momentumFactor; wallSlideSpeed = attributes.wallSlideSpeed; pivotTime = attributes.pivotTime; diveAttackTime = attributes.diveAttackTime; momentumTime = attributes.momentumTime; wallStickCooldown = attributes.wallStickCooldown; terminalVel = new Vector2(dashSpeed / 2.0f, dashSpeed / 2.5f); airTerminalVel = new Vector2(dashSpeed / 3.0f, dashSpeed); slopeCollisionMask = attributes.slopeCollisionMask; gravity = attributes.gravity; }
void Start() { pc = GetComponent <Player_Con>(); animator = GetComponent <Player_Animator>(); timers = GetComponent <Player_Timers>(); pDash = GetComponent <Player_Dash>(); pJump = GetComponent <Player_Jump>(); pDive = GetComponent <Player_Dive>(); pCol = GetComponent <Player_Collisions>(); pAttack = GetComponent <Player_Attack>(); wallActions = GetComponent <Player_Wall_Actions>(); speedManager = GetComponent <Speed_Manager>(); ReceiveValues(); jumpTime = attributes.jumpTime; displacementTime = attributes.displacementTime; pivotTime = attributes.pivotTime; momentumTime = attributes.momentumTime; wallStickCooldown = attributes.wallStickCooldown; jumpCount = 2; sign = 0.0f; prevSign = 1.0f; wallSign = 0.0f; jumpDirX = 0.0f; enemyColSign = 0.0f; control = true; airborne = true; //Lines below for testing purposes dive = true; dash = true; doubleJump = true; }