void Awake() { collision = GetComponent <Collision>(); rigidbody = GetComponent <Rigidbody2D>(); improvedJump = GetComponent <ImprovedJump>(); ghostTrail = GetComponent <GhostTrail>(); }
private void InstantiateGhost() { if (FindObjectOfType <GhostTrail>() == null) { GameObject clone = Instantiate(ghost, new Vector2(-20, -20), Quaternion.identity); cloneGhost = clone.GetComponent <GhostTrail>(); } }
private void Start() // This is called when the level start so only once { x = Input.GetAxisRaw("Horizontal"); anim = GetComponent <Animator>(); // Initialize the animator for when the game starts rigidy = GetComponent <Rigidbody2D>(); // Initialize the rigidbody for the player ghost = GetComponent <GhostTrail>(); facingRight = true; }
protected override void OnAwake() { base.OnAwake(); dashAB = gameObject.AddComponent <Ability>() as Ability; dashAB.InitSetParams(dashDuration, dashInvertal); if (ghostTrail == null) { ghostTrail = FindObjectOfType <GhostTrail>(); } }
// Start is called before the first frame update void Start() { rb = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); cam = FindObjectOfType <CameraController>(); ghostTrail = this.GetComponent <GhostTrail>(); jumpParticle = transform.GetChild(0).GetComponent <ParticleSystem>(); facingRight = true; GRAVITY = rb.gravityScale; DRAG = rb.drag; jumpTimerLeft = 0; isWalking = true; rb.freezeRotation = true; dashVanilla = Dash(direction, DASH_FORCE, DASH_TIME, DASH_DRAG); dashBounce = Dash(direction, DASH_FORCE, DASH_TIME, DASH_DRAG); }
//public float respawnDelay; // Start is called before the first frame update void Start() { player = FindObjectOfType <Movement>(); ghost = FindObjectOfType <GhostTrail>(); resets = FindObjectsOfType <DashReset>(); }
private void Awake() { lm = GameObject.FindGameObjectWithTag("Levelman").GetComponent <LevelMaster>(); move = GetComponent <GhostTrail>(); sA = GameObject.FindGameObjectWithTag("Special").GetComponent <SpecialAttack>().instance; }
private void Awake() { lm = GameObject.FindGameObjectWithTag("Levelman").GetComponent <LevelMaster>(); move = GetComponent <GhostTrail>(); }