public override void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { if (collider.direction == RC_Direction.DOWN) { characterIsOnMe = true; standTimer = standTime; } }
override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { if (collider.direction == RC_Direction.DOWN) { character.Velocity = new Vector3(character.Velocity.x, springForce); } }
public override void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { if (collider.direction == RC_Direction.DOWN && !fallStarted) { fallStarted = true; StartCoroutine(Fall()); } }
override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { // If we are standing on this if (!alreadyAdded && collider.direction == RC_Direction.DOWN) { character.Velocity += speed; alreadyAdded = true; } }
/// <summary> /// Stand on a respawn point to activate it. You could play a particle effect of something here. /// </summary> override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { if (collider.direction == RC_Direction.DOWN) { currentRespawnPoint = this; } }
override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { if (character.FallThroughTimer <= 0.0f && collider.direction == RC_Direction.DOWN && character.characterInput.dropFromPlatform) { character.FallThroughTimer = fallThroughTime; } }
override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { if (collider.direction == RC_Direction.DOWN) { characterIsOnMe = true; standTimer = standTime; } }
override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { // Hitting from below if (collider.direction == RC_Direction.UP) { if (particles != null) particles.Play(); myCollider.enabled = false; myRenderer.enabled = false; } }
override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { if (character.StartedClimbing) { // Move off ladder if (control.dismountWithArrows && character.characterInput.x != 0.0f) { character.Dismount(this); } } }
override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { if (collider.direction == RC_Direction.DOWN && !fallStarted) { fallStarted = true; StartCoroutine(Fall()); } }
override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { // If we are standing on this if (!alreadyAdded && collider.direction == RC_Direction.DOWN) { character.SetDrag(drag); alreadyAdded = true; } }
/// <summary> /// Trigger the respawn. /// </summary> override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { SimpleHealth2D health = character.GetComponent <SimpleHealth2D>(); if (health != null && health.Health > 0) { health.Die(); } }
override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { // Hitting from below if (collider.direction == RC_Direction.UP) { if (particles != null) { particles.Play(); } myCollider.enabled = false; myRenderer.enabled = false; } }
override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { // Hitting from below (i.e. a headbutt) if (isActive && collider.direction == RC_Direction.UP) { StartCoroutine(DoHit()); if (spawnGameObject != null && !hasSpawned) StartCoroutine(DoSpawn()); else if (spawnGameObject != null) DoBobble(); } // Kill enemies above /*else if (!isActive && collider.direction == RC_Direction.DOWN && character is IEnemy) { ((IEnemy)character).Kill(); } */ }
void Start() { raycastCollider = GetComponent <RaycastCollider2D>(); input = GetComponent <InputManager>(); timers = GetComponent <Timers>(); stats = GetComponent <PlayerStats>(); sprite = GetComponent <SpriteRenderer>(); anim = GetComponent <CharacterAnimationController>(); // Init all timers timers.RegisterTimer("jumpBuffer", inputBufferTimeSeconds); timers.RegisterTimer("coyoteBuffer", coyoteTimeSeconds); timers.RegisterTimer("platformFallThrough", platformFallThroughSeconds); timers.RegisterTimer("dashBuffer", dashCooldownSeconds); // make teleporter sprite deactivated teleporter.GetComponent <Renderer>().enabled = false; }
override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { // Hitting from below (i.e. a headbutt) if (isActive && collider.direction == RC_Direction.UP) { StartCoroutine(DoHit()); if (spawnGameObject != null && !hasSpawned) { StartCoroutine(DoSpawn()); } else if (spawnGameObject != null) { DoBobble(); } } // Kill enemies above /*else if (!isActive && collider.direction == RC_Direction.DOWN && character is IEnemy) { * ((IEnemy)character).Kill(); * } */ }
/// <summary> /// This is called when a platform is hit. Override to implement platform behaviour. /// </summary> /// <param name='collider'> /// The collider that did the hitting. /// </param> /// <param name='character'> /// The character that did the hitting. /// </param> virtual public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { // Do nothing }
/// <summary> /// Trigger the respawn. /// </summary> override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { SimpleHealth2D health = character.GetComponent<SimpleHealth2D>(); if (health != null && health.Health > 0) { health.Die (); } }
public void Init(RaycastCollider2D raycastCollider) { parentRaycast = raycastCollider; Reset(); }
/// <summary> /// Stand on a respawn point to activate it. You could play a particle effect of something here. /// </summary> override public void DoAction(RaycastCollider2D collider, RaycastCharacterController2D character) { if (collider.direction == RC_Direction.DOWN) currentRespawnPoint = this; }