示例#1
0
 void Start()
 {
     rb             = GetComponent <Rigidbody2D>();
     state          = GetComponent <Player_State>();
     animator       = GetComponent <Player_Animator>();
     timers         = GetComponent <Player_Timers>();
     attributes     = state.attributes;
     speedManager   = GetComponent <Speed_Manager>();
     velocity       = speedManager.velocity;
     onGround       = state.onGround;
     onWall         = state.onWall;
     onSlope        = state.onSlope;
     onQuicksand    = state.onQuicksand;
     airborne       = state.airborne;
     control        = state.control;
     pivoting       = state.pivoting;
     dashing        = state.dashing;
     sprinting      = state.sprinting;
     input          = state.input;
     sign           = state.sign;
     prevSign       = state.prevSign;
     pivotSign      = state.pivotSign;
     pivotTimer     = timers.pivotTimer;
     momentumTimer  = timers.momentumTimer;
     moveSpeed      = attributes.moveSpeed;
     momentumFactor = attributes.momentumFactor;
     pivotTime      = attributes.pivotTime;
     momentumTime   = attributes.momentumTime;
     rb.drag        = attributes.rbDrag;
     rb.mass        = attributes.rbMass;
     gravity        = attributes.gravity;
 }
 void Start()
 {
     state                  = GetComponent <Player_State>();
     animator               = GetComponent <Player_Animator>();
     timers                 = GetComponent <Player_Timers>();
     attributes             = state.attributes;
     speedManager           = GetComponent <Speed_Manager>();
     velocity               = speedManager.velocity;
     jumpCount              = state.jumpCount;
     onGround               = state.onGround;
     onWall                 = state.onWall;
     control                = state.control;
     wantToJump             = state.wantToJump;
     wallSliding            = state.wallSliding;
     wallClimbing           = state.wallClimbing;
     wallJumping            = state.wallJumping;
     stunned                = state.stunned;
     sign                   = state.sign;
     wallSign               = state.wallSign;
     jumpBufferTimer        = timers.jumpBufferTimer;
     wallStickTimer         = timers.wallStickTimer;
     wallClimbTimer         = timers.wallClimbTimer;
     wallClimbCooldownTimer = timers.wallClimbCooldownTimer;
     wallJumpTimer          = timers.wallJumpTimer;
     wallJumpCooldownTimer  = timers.wallJumpCooldownTimer;
     moveSpeed              = attributes.moveSpeed;
     wallSlideSpeed         = attributes.wallSlideSpeed;
     wallClimbVel           = attributes.wallClimbVel;
     wallJumpVel            = attributes.wallJumpVel;
     wallStickCooldown      = attributes.wallStickCooldown;
     wallClimbCooldown      = attributes.wallClimbCooldown;
     wallClimbTime          = attributes.wallClimbTime;
     wallJumpCooldown       = attributes.wallJumpCooldown;
     wallJumpTime           = attributes.wallJumpTime;
 }
示例#3
0
 void Start()
 {
     state             = GetComponent <Player_State>();
     animator          = GetComponent <Player_Animator>();
     timers            = GetComponent <Player_Timers>();
     attributes        = state.attributes;
     speedManager      = GetComponent <Speed_Manager>();
     leftWallCheck     = gameObject.transform.GetChild(2).gameObject.GetComponent <WallCheck>();
     rightWallCheck    = gameObject.transform.GetChild(3).gameObject.GetComponent <WallCheck>();
     velocity          = speedManager.velocity;
     onWall            = state.onWall;
     control           = state.control;
     dashing           = state.dashing;
     dashReady         = state.dashReady;
     dashAttacking     = state.dashAttacking;
     stunned           = state.stunned;
     input             = state.input;
     dashDir           = state.dashDir;
     dash              = state.dash;
     dashCooldownTimer = timers.dashCooldownTimer;
     dashAttackTimer   = timers.dashCooldownTimer;
     dashTimer         = timers.dashTimer;
     momentumTimer     = timers.momentumTimer;
     moveSpeed         = attributes.moveSpeed;
     dashSpeed         = attributes.dashSpeed;
     dashCooldownTime  = attributes.dashCooldownTime;
     dashTime          = attributes.dashTime;
     dashAttackTime    = attributes.dashAttackTime;
     momentumTime      = attributes.momentumTime;
     collisionMask     = attributes.collisionMask;
 }
示例#4
0
 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;
 }
示例#5
0
 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;
 }
示例#6
0
 void Start()
 {
     ren      = GetComponent <SpriteRenderer>();
     animator = GetComponent <Animator>();
     state    = GetComponent <Player_State>();
     timers   = GetComponent <Player_Timers>();
     manager  = GetComponent <PlayerManager>();
 }
示例#7
0
 void Start()
 {
     Player     = gameObject.transform.parent.gameObject;
     state      = Player.GetComponent <Player_State>();
     timers     = Player.GetComponent <Player_Timers>();
     attributes = state.attributes;
     collisions = Player.GetComponent <Player_Collisions>();
     attacking  = false;
 }
示例#8
0
 // Start is called before the first frame update
 void Start()
 {
     pc            = GameObject.Find("Player");
     speedManager  = pc.GetComponent <Speed_Manager>();
     state         = pc.GetComponent <Player_State>();
     animator      = pc.GetComponent <Player_Animator>();
     timers        = pc.GetComponent <Player_Timers>();
     playerManager = pc.GetComponent <PlayerManager>();
     attributes    = state.attributes;
 }
 void Start()
 {
     state          = GetComponent <Player_State>();
     animator       = GetComponent <Player_Animator>();
     timers         = GetComponent <Player_Timers>();
     attributes     = state.attributes;
     knockbackSpeed = attributes.knockbackSpeed;
     stunTime       = attributes.stunTime;
     immuneTime     = attributes.immuneTime;
 }
示例#10
0
 void Start()
 {
     state          = GetComponent <Player_State>();
     animator       = GetComponent <Player_Animator>();
     timers         = GetComponent <Player_Timers>();
     attributes     = state.attributes;
     leftWallCheck  = gameObject.transform.GetChild(2).gameObject.GetComponent <WallCheck>();
     rightWallCheck = gameObject.transform.GetChild(3).gameObject.GetComponent <WallCheck>();
     ReceiveValues();
     attackTime = attributes.attackTime;
 }
示例#11
0
 void Start()
 {
     state       = GetComponent <Player_State>();
     animator    = GetComponent <Player_Animator>();
     timers      = GetComponent <Player_Timers>();
     attributes  = state.attributes;
     groundCheck = gameObject.transform.GetChild(1).gameObject.GetComponent <GroundCheck>();
     ReceiveValues();
     moveSpeed         = attributes.moveSpeed;
     jumpVelocity      = attributes.jumpVelocity;
     diveSpeed         = attributes.diveSpeed;
     landingTime       = attributes.landingTime;
     diveAttackTime    = attributes.diveAttackTime;
     diveCollisionMask = attributes.diveCollisionMask;
 }
示例#12
0
 // Start is called before the first frame update
 void Start()
 {
     player       = GameObject.Find("Player");
     speedManager = player.GetComponent <Speed_Manager>();
     state        = player.GetComponent <Player_State>();
     animator     = player.GetComponent <Player_Animator>();
     timers       = player.GetComponent <Player_Timers>();
     attributes   = state.attributes;
     deathTime    = attributes.deathTime;
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
示例#13
0
 void Start()
 {
     state             = GetComponent <Player_State>();
     animator          = GetComponent <Player_Animator>();
     timers            = GetComponent <Player_Timers>();
     attributes        = state.attributes;
     jumpCount         = state.jumpCount;
     onGround          = state.onGround;
     onQuicksand       = state.onQuicksand;
     onWall            = state.onWall;
     airborne          = state.airborne;
     control           = state.control;
     wantToJump        = state.wantToJump;
     jumping           = state.jumping;
     doubleJumping     = state.doubleJumping;
     displacementTimer = timers.displacementTimer;
     jumpBufferTimer   = timers.jumpBufferTimer;
     jumpTimer         = timers.jumpTimer;
     jumpBufferTime    = attributes.jumpBufferTime;
     jumpTime          = attributes.jumpTime;
 }