public void Initiate(float displayTime, Sprite sprite, DashTrail trail) { mDisplayTime = displayTime; mRenderer.sprite = sprite; mTimeDisplayed = 0; mSpawner = trail; }
public void Dash() { if (canMove && canDash) { if (dashEnergy > dashEnergyCost) { dashEnergy -= dashEnergyCost; dashing = true; afterDash = false; canMove = false; dashTime = dashDuration; dashDirection = lastInputMove; PlayAnimation(AnimationsStates.Dash, true); if (character != null) { character.canAttack = false; if (character.weapon != null) { SNWeapon.SetAnimationDirection(character.weapon.weaponAnimator, dashDirection); character.weapon.weaponAnimator.Play("Idle"); character.weapon.weaponAnimator.Play(AnimationsStates.Dash.ToString()); if (dashDealDamage) { character.weapon.EnableAttack("Dash"); } } } if (dashEffectObject != null) { DashTrail trail = dashEffectObject.GetComponent <DashTrail> (); if (trail != null) { trail.Show(Angle(dashDirection)); if ((character != null) && (character.spriteRenderer != null)) { character.spriteRenderer.enabled = false; } } } if (dashEffectPrefab != null) { GameObject dashEffectAnimObject = Instantiate(dashEffectPrefab); dashEffectAnimObject.transform.position = character.characterTransform.position; Destroy(dashEffectAnimObject, 1); } if (dashIgnoreCollisions) { topDownPhysics.SetCollitionGhostLevel(); } if (dashImmuneDamage) { if (hurtbox != null) { hurtbox.SetActive(false); } } } } }
private void Start() { rigid = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); trail = GetComponentInChildren <DashTrail>(); enemyManager = GetComponent <EnemyManager>(); effectManager = StatusEffectManager.instance; }
public void Initiate(float displayTime, Sprite sprite, Vector2 position, DashTrail trail) { mDisplayTime = displayTime; mRenderer.sprite = sprite; mRenderer.enabled = true; mPosition = position; mTimeDisplayed = 0; mSpawner = trail; mbInUse = true; }
void Start() { rb = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); posCheckGround = transform.GetChild(0); dashtrail = GetComponent <DashTrail>(); effectRun = transform.GetChild(1).gameObject; shieldPlayer = transform.GetChild(2).gameObject; magnetPlayer = transform.GetChild(3).gameObject; }
// Start is called before the first frame update void Start() { _currentMoveVector = new Vector3(0.0f, 0.0f, 0.0f); _currentLookRotation = transform.rotation; timeSinceDash = Time.time; dashSpeed = speed * 2; currentSpeed = speed; dashTrail = model.GetComponent <DashTrail>(); }
void Start() { _timeController = EventController.Instance.GetComponent <TimeController>(); _timeController.StartTime(); _uiController = GameObject.Find("Canvas").GetComponent <UIController>(); rb = GetComponent <Rigidbody2D>(); Cameras = GameObject.FindGameObjectsWithTag("Camera"); Microphones = GameObject.FindGameObjectsWithTag("Microphone"); animator = GetComponent <Animator>(); _dashTrail = GetComponentInChildren <DashTrail>(); }
// Use this for initialization private void Awake() { // Get the needed components. _agent = GetComponent <Agent>(); _agent.IsPlayerAgent = true; _dashTrail = GetComponentInChildren <DashTrail>(); _skeletonAnimation = GetComponentInChildren <SkeletonAnimation>(); // Set floor. Floor = Level.Instance.ReturnFloorLevel(transform.position); }
// Start is called before the first frame update void Start() { rigid = GetComponent <Rigidbody2D>(); animator = GetComponent <Animator>(); spriteRenderer = GetComponent <SpriteRenderer>(); manager = GameManager.instance; feetCollider = GetComponentInChildren <CircleCollider2D>(); bodyCollider = GetComponentInChildren <BoxCollider2D>(); trail = GetComponentInChildren <DashTrail>(); tracker = ProgressionTracker.instance; pauseMenuManager = PauseMenuManager.instance; PlayerManager = PlayerManager.instance; }
public void Initiate(float displayTime, Sprite sprite, Vector2 position, DashTrail trail) { gameObject.SetActive(true); this.displayTime = displayTime; transform.position = this.position = position; renderer.sprite = sprite; timeDisplayed = 0; startColor = trail.startColor; endColor = trail.endColor; renderer.flipX = trail.leadingSprite.flipX; renderer.color = Color.Lerp(startColor, endColor, timeDisplayed / displayTime); }
public void DashEnd() { if (dashing) { dashing = false; canMove = true; afterDash = true; if (character != null) { character.canAttack = true; } if (dashEffectObject != null) { DashTrail trail = dashEffectObject.GetComponent <DashTrail> (); if (trail != null) { trail.Hide(); if ((character != null) && (character.spriteRenderer != null)) { character.spriteRenderer.enabled = true; } } } if (dashIgnoreCollisions) { topDownPhysics.SetCollitionGroundLevel(true); } if (dashDealDamage) { if ((character != null) && (character.weapon != null)) { character.weapon.DisableAttack(); } } if (dashImmuneDamage) { if (hurtbox != null) { hurtbox.SetActive(true); } } StartCoroutine(EndDashAnim(0.3f)); UnlockAnimations(); canDash = false; StartCoroutine(DashInterval()); } }