// Use this for initialization void Start() { enemyPhysics = GetComponent <EntityPhysics>(); targetSpeed = 0; currentSpeed = 0; }
// Use this for initialization void Start() { enemyPhysics = GetComponent<EntityPhysics>(); targetSpeed = 0; currentSpeed = 0; }
// Use this for initialization void Start() { physics = GetComponent <EntityPhysics>(); entity = GetComponent <Entity>(); animator = GetComponent <Animator>(); bulletPool = GetComponent <BulletPool>(); sprite = GetComponent <SpriteRenderer>(); }
public override void Init(Enemy e, OnActionStateChanged onActionFinished) { base.Init(e, onActionFinished); anim = e.anim; body = e.body; projectilePool = projectilePrefab.GetComponent <Projectile>().GetObjectPooler(); shootPointPos = shootPoint.localPosition; }
public override void Init (EntityPhysics body, Player player, Pawn heroData) { cooldownTimers = new float[2]; base.Init (body, player, heroData); InitAbilities(); // Handle input onDragRelease = RushAbility; onTap = AreaAttack; player.OnPlayerTryHit += CheckKnightShieldHit; }
public override void OnHitGround(EntityPhysics other) { foreach (TriggerObject linkedLeverButton in linkedLeverButtons) { if (linkedLeverButton.isActivated) { VelocityY = 0; } } }
public override void Init(EntityPhysics body, Player player, Pawn heroData) { cooldownTimers = new float[2]; base.Init(body, player, heroData); projectilePool = (RuntimeObjectPooler)projectilePrefab.GetComponent <Projectile>().GetObjectPooler(); onDragRelease = DashAttack; onTap = NinjaStar; InitAbilities(); }
private void Start() { parentEntity.AddSubEntity(Entity); _parentPhysicsMover = parentEntity.GetComponent <EntityPhysics>(); CreateJoint(); CreateCollider(); Rigidbody.maxAngularVelocity = 20f; _cacheRotation = referenceBone.rotation; Entity.LateTick += SyncReferenceBone; Entity.FixedTick += Simulate; }
public override void Enter() { base.Enter(); m_automaton = stateMachine.automaton; m_physics = m_automaton.physics; m_inputManager = stateMachine.automaton.inputManager; // Necessary to keep track of history. SaveToHistory(); }
public override void Enter() { base.Enter(); EntityPhysics entityPhysics = stateMachine.automaton.physics; entityPhysics.currentSpeed = entityPhysics.dashInitialSpeed; m_inputManager = stateMachine.automaton.inputManager; // Necessary to keep track of history. SaveToHistory(); }
public override void Enter() { base.Enter(); m_physics = stateMachine.automaton.physics; m_currentSpeed = 1.0f; m_brakeForce = 1.0f / (maxFrame / 2.0f); m_inputManager = stateMachine.automaton.inputManager; m_initMoveDir = m_inputManager.moveDir; // Necessary to keep track of history. SaveToHistory(); }
public override void Init(EntityPhysics body, Player player, Pawn heroData) { cooldownTimers = new float[2]; map = GameObject.Find("Map").GetComponent <Map>(); fireballPool = (RuntimeObjectPooler)projectilePrefab.GetComponent <Projectile>().GetObjectPooler(); meteorPool = (RuntimeObjectPooler)meteorPrefab.GetComponent <Projectile>().GetObjectPooler(); base.Init(body, player, heroData); defaultAnim = anim; onDragRelease = ShootFireball; onTap = StartTeleport; InitAbilities(); }
public void HandleHurt(HitBoxCollision hbc) { Debug.Log(hbc.toString()); var stats = hbc.hitStats; /* * var kb = 30f; * //TODO: Calculate KB * knockback.x = kb * Mathf.Sin(Mathf.Deg2Rad * hbc.hitStats.angle); * knockback.y = kb * Mathf.Cos(Mathf.Deg2Rad * hbc.hitStats.angle); */ var kb = EntityPhysics.CalculateKnockback(30f, stats.damage, weight, stats.baseKnockback, stats.knockBackGrowth); knockback = EntityPhysics.CalculateKnockbackComponents(kb, stats.angle); Debug.Log(knockback); }
public override void Step() { //hitLagAlarm.CustomUpdate(); character.knockback -= EntityPhysics.GetKnockbackDecay(launchAngle); if (character.timer == 1) { character.inHitLag = true; character.hitLagAlarm.SetAlarm(30, () => { character.inHitLag = false; Debug.Log("I'm done here"); }); } if (character.timer >= time) { OnStateExit(); character.currentState = new StateIdle(character); } }
/// <summary> /// Handles reported hitbox collisions /// </summary> /// <param name="hbc"></param> public new void HandleHurt(HitBoxCollision hbc) { Debug.Log("Handdleeee"); velocity = new Vector3(0f, 0f, 0f); var stats = hbc.hitStats; damage += stats.damage; var kb = EntityPhysics.CalculateKnockback(damage, stats.damage, weight, stats.baseKnockback, stats.knockBackGrowth); hitstunFrames = EntityPhysics.CalculateHitstun(kb); isTumble = hitstunFrames > 32; knockback = EntityPhysics.CalculateKnockbackComponents(kb, stats.angle); hitData = hbc; //currentState = new StateHurt(this); SwitchState(stateHurt); }
void Start() { physics = GetComponent <EntityPhysics>(); combatModule = GetComponent <CombatModule>(); //animator = GetComponent<Animator>(); playerInput = GetComponent <PlayerInput>(); runDustParticles.Stop(); landDustParticles.Stop(); jumpDustParticles.Stop(); turnaroundDustParticles.Stop(); wallJumpDustParticles.Stop(); currentNumberOfJumps = m_NumberOfJumpsInAir; currentNumberOfWallJumps = m_NumberOfWallJumps; currentNumberOfAirDodges = m_NumberOfAirDodges; wallJumpMask = LayerMask.GetMask("Environment", "CombatEnvironment"); p = ReInput.players.GetPlayer(playerNumber); //InitializeInputStructs(); SetupDictionaries(); LoadFrameData(); }
public virtual void Init(EntityPhysics body, Player player, Pawn heroData) { powerUpManager = GetComponent <HeroPowerUpManager> (); this.body = body; this.player = player; sound = SoundManager.instance; anim = heroData.GetAnimationSet(); anim.Init(player.animPlayer); anim.player.Init(); damageMultiplier = 1f; baseDamage = Mathf.RoundToInt(Pawn.DamageEquation(heroData)); // init cooldownMultipliers cooldownMultipliers = new float[cooldownTime.Length]; for (int i = 0; i < cooldownTime.Length; i++) { cooldownMultipliers [i] = 1; } player.maxHealth = maxHealth; powerUpManager.Init(heroData); player.OnPlayerDamaged += ResetCombo; player.OnEnemyDamaged += IncrementCombo; player.OnEnemyDamaged += IncrementSpecialAbilityCharge; }
// Use this for initialization void Start () { physics = GetComponent<EntityPhysics> (); anim = body.GetComponent<Animator> (); }
public virtual void Init(Enemy e, Transform player) { this.enemy = e; this.body = e.body; this.player = player; }
public void AttachPhysics(float width, float height, float gravityModifier = 1f, System.Action onTileCallback = null) { _physics = new EntityPhysics(new EntityAABBCollider(this, width, height), gravityModifier, onTileCallback); }
public override void Init(Enemy e, OnActionStateChanged onActionFinished) { base.Init(e, onActionFinished); body = e.body; defaultSpeed = e.DEFAULT_SPEED; }
// Use this for initialization void Start() { physics = GetComponent<EntityPhysics>(); entity = GetComponent<Entity>(); animator = GetComponent<Animator>(); bulletPool = GetComponent<BulletPool>(); sprite = GetComponent<SpriteRenderer>(); }