// Use this for initialization void Start() { myRB = GetComponent <Rigidbody>(); myAir = GetComponent <PlayerAir>(); PSBoost = transform.Find("Effects").Find("PSBoost").GetComponent <BoostPSScript>(); myAC = GetComponentInChildren <AnimationControl>(); }
void Start() { bitModel = transform.GetChild(0).gameObject; myAir = transform.parent.parent.GetComponent <PlayerAir>(); drillEngaged = GetComponent <AudioSource>(); drillEngaged.volume = 0; }
public override void _Ready() { _collision_layer = 1; ((Area)FindNode("MeleAttackArea")).SetCollisionMaskBit(2, true); // monitor only enemies AddToGroup("player"); var st_ground = new PlayerGround(); var st_air = new PlayerAir(); var st_skill1 = new PlayerSkill1(); var st_skill3 = new PlayerSkill3(); var tr_jump = new PlayerJump(st_air); var tr_fall = new PlayerFall(st_air); var tr_land = new PlayerLand(st_ground); var tr_skill1 = new PlayerActivateSkill(st_skill1, 0, GD.KEY_Z); var tr_skill3 = new PlayerActivateSkill(st_skill3, 2, GD.KEY_C); st_ground.AddTransition(tr_jump); st_ground.AddTransition(tr_fall); st_ground.AddTransition(tr_skill1); st_ground.AddTransition(tr_skill3); st_air.AddTransition(tr_land); st_air.AddTransition(tr_skill1); st_air.AddTransition(tr_skill3); st_skill1.AddTransition(new FromOneShotAnim(st_ground, "skills")); st_skill3.AddTransition(new FromOneShotAnim(st_ground, "skills")); _fsm = new FSM(this, st_ground); // Attributes Attributes.Level = 0; Attributes.RunSpeed = 8; Attributes.JumpHeight = 4; Attributes.MaxHealth = 100; Attributes.Health = Attributes.MaxHealth; Attributes.Damage = 10; Attributes.CritChance = 0.1f; Attributes.Experience = 0.0f; Attributes.NextLevelExperience = 100; }
void Awake() { Animator = GetComponent <Animator>(); PlayerStatus = GetComponent <PlayerStatus>(); Rigidbody = GetComponent <Rigidbody2D>(); PlayerGround = new PlayerGround(this); PlayerGroundDash = new PlayerGroundDash(this); PlayerAirDash = new PlayerAirDash(this); PlayerWallDash = new PlayerWallDash(this); PlayerAir = new PlayerAir(this); PlayerJump = new PlayerJump(this); PlayerTakingDamage = new PlayerTakingDamage(this); PlayerAttackWeakGround = new PlayerAttackWeakGround(this); PlayerAttackWeakAir = new PlayerAttackWeakAir(this); PlayerAttackHeavyGround = new PlayerAttackHeavyGround(this); PlayerAttackHeavyAir = new PlayerAttackHeavyAir(this); PlayerWall = new PlayerWall(this); input = GetComponent <IInput>(); }
private void Start() { myPlayerSpline = GetComponent <PlayerSpline>(); myPlayerJump = GetComponent <PlayerJump>(); myPlayerAir = GetComponent <PlayerAir>(); myPlayerInput = GetComponent <PlayerInput>(); myPlayerDeath = GetComponent <PlayerDeath>(); myPlayerCollision = GetComponentInChildren <PlayerCollision>(); myPlayerBobbing = GetComponent <PlayerBobbing>(); myPlayerBackflip = GetComponentInChildren <PlayerBackflip>(); myCurrentSpeed = myBaseSpeed; if (mySplineManager == null) { Debug.LogError(this + " has no splineManager!"); return; } if (myCamera == null) { Debug.LogError(this + " has no camera!"); } }