コード例 #1
0
ファイル: BasicEnemy.cs プロジェクト: toddef/SCFG
    // Use this for initialization
    void Start()
    {
        enemyPhysics = GetComponent <EntityPhysics>();

        targetSpeed  = 0;
        currentSpeed = 0;
    }
コード例 #2
0
ファイル: BasicEnemy.cs プロジェクト: JTReed/SCFG
    // Use this for initialization
    void Start()
    {
        enemyPhysics = GetComponent<EntityPhysics>();

        targetSpeed = 0;
        currentSpeed = 0;
    }
コード例 #3
0
 // Use this for initialization
 void Start()
 {
     physics    = GetComponent <EntityPhysics>();
     entity     = GetComponent <Entity>();
     animator   = GetComponent <Animator>();
     bulletPool = GetComponent <BulletPool>();
     sprite     = GetComponent <SpriteRenderer>();
 }
コード例 #4
0
 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;
 }
コード例 #5
0
ファイル: KnightHero.cs プロジェクト: bigstupidx/gameWaveRush
	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;
	}
コード例 #6
0
 public override void OnHitGround(EntityPhysics other)
 {
     foreach (TriggerObject linkedLeverButton in linkedLeverButtons)
     {
         if (linkedLeverButton.isActivated)
         {
             VelocityY = 0;
         }
     }
 }
コード例 #7
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();
    }
コード例 #8
0
 private void Start()
 {
     parentEntity.AddSubEntity(Entity);
     _parentPhysicsMover = parentEntity.GetComponent <EntityPhysics>();
     CreateJoint();
     CreateCollider();
     Rigidbody.maxAngularVelocity = 20f;
     _cacheRotation    = referenceBone.rotation;
     Entity.LateTick  += SyncReferenceBone;
     Entity.FixedTick += Simulate;
 }
コード例 #9
0
ファイル: EntityIdleState.cs プロジェクト: m4jr0/SmashLike
    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();
    }
コード例 #10
0
ファイル: EntityJumpState.cs プロジェクト: m4jr0/SmashLike
    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();
    }
コード例 #11
0
    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();
    }
コード例 #12
0
    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();
    }
コード例 #13
0
    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);
    }
コード例 #14
0
    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);
        }
    }
コード例 #15
0
    /// <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);
    }
コード例 #16
0
    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();
    }
コード例 #17
0
ファイル: PlayerHero.cs プロジェクト: bigstupidx/gameWaveRush
    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;
    }
コード例 #18
0
	// Use this for initialization
	void Start () {
		physics = GetComponent<EntityPhysics> ();
		anim = body.GetComponent<Animator> ();

	}
コード例 #19
0
 public virtual void Init(Enemy e, Transform player)
 {
     this.enemy  = e;
     this.body   = e.body;
     this.player = player;
 }
コード例 #20
0
 public void AttachPhysics(float width, float height, float gravityModifier = 1f, System.Action onTileCallback = null)
 {
     _physics = new EntityPhysics(new EntityAABBCollider(this, width, height), gravityModifier, onTileCallback);
 }
コード例 #21
0
ファイル: EA_Lunge.cs プロジェクト: bigstupidx/gameWaveRush
 public override void Init(Enemy e, OnActionStateChanged onActionFinished)
 {
     base.Init(e, onActionFinished);
     body         = e.body;
     defaultSpeed = e.DEFAULT_SPEED;
 }
コード例 #22
0
ファイル: PlayerController.cs プロジェクト: JTReed/SCFG
 // Use this for initialization
 void Start()
 {
     physics = GetComponent<EntityPhysics>();
     entity = GetComponent<Entity>();
     animator = GetComponent<Animator>();
     bulletPool = GetComponent<BulletPool>();
     sprite = GetComponent<SpriteRenderer>();
 }