// アクション ================================================================================

    // stay ----------------------------------------------------

    void stay(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(staying);


            //state.setPhysics( physStayOnWall );

            posture.setCollision(collisionWallInStay);


            motion.fadeIn(msStand, 0.3f);

            msStand.speed = def.quickness * figure.scaleRateR;


            releaseTime = 0.0f;


            posture.fittingRate = 30.0f;
        };

        action.last = () =>
        {
            posture.fittingRate = 3.0f;
        };
    }
Beispiel #2
0
    // blowing ----------------------------------------------------

    void blow(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(browing);


            state.setPhysics(physFree);
            shiftToPhysicalMode();
            posture.setCollision(null);


            // 復帰スピードは move による。回復値は元のモーションのものとなる。


            motion.fadeIn(ms.walk, 0.2f);              //ms.damage, 0.2f );

            ms.damage.speed = stance.getMotionSpeed(this);


            rb.constraints = RigidbodyConstraints.None;
        };

        action.last = () =>
        {
            rb.constraints = figure.rbDefaultConstraints;

            //shiftToPhysicalMode();
        };
    }
    // jump ------------------------------------------

    void jump(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            if (isGround())
            {
                state.shiftTo(preJumping);

                msJumpStart.speed = def.quickness * figure.scaleRateR * (isBattling ? 1.5f : 1.0f);
            }
            else
            {
                //state.changeTo( stay );
                state.shiftTo(jumpingDown);
            }


            //state.setPhysics( physStayOnWall );

            posture.setCollision(collisionWallInStay);


            motion.fadeIn(msJumpStart, 0.1f);


            moveSpeed.set(0.0f);

            posture.fittingRate = 30.0f;
        };

        action.last = () =>
        {
            posture.fittingRate = 3.0f;
        };
    }
Beispiel #4
0
    // wire -------------------------------------------------------

    void wire(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(wiring);              // shootingWire );

            state.setPhysics(physFree);         // physHitCheckWall );


            changeToStand();


            msNowWaponUpperStance = msWaponUpperStance;

            motionUpperBody.fadeIn(msNowWaponUpperStance, 0.1f);


            isRunable = true;

            output.set(1.0f, 1.5f, 1.0f, 1.0f, 0.0f);
        };

        action.last = () =>
        {
            isRunable = true;
        };
    }
Beispiel #5
0
    // damaging ----------------------------------------------------

    void damage(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(damaging);

            //state.setPhysics( physStayOnWall );
            //setPhysicsStayMode();
            //shiftToPhysicalMode();

            posture.setCollision(collisionWallInStay);


            // 復帰スピードは move による。回復値は元のモーションのものとなる。


            motion.fadeIn(ms.damage, 0.2f);

            ms.damage.speed = stance.getMotionSpeed(this);
        };

        action.last = () =>
        {
            //shiftToPhysicalMode();
        };
    }
    // blowing ----------------------------------------------------

    void blow(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(browing);


            state.setPhysics(physFree);
            posture.setCollision(null);
            shiftToPhysicalMode();


            motion.fadeIn(msWalk, 0.2f);              //msDamage, 0.2f );

            msDamage.speed = def.quickness * figure.scaleRateR;


            rb.constraints = RigidbodyConstraints.None;
        };

        action.last = () =>
        {
            rb.constraints = figure.rbDefaultConstraints;
        };
    }
Beispiel #7
0
    // アクション ================================================================================

    // stay ----------------------------------------------------

    void stay(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(staying);

            state.setPhysics(physStayOnWall);
            posture.setCollision(collisionWallInStay);


            migration.setTimer(Random.Range(1.0f, 6.0f));

            move.setRepairTime(1.5f);

            stance.setActionSpeed(1.0f);


            wriggler.bendAndTurn();

            motion.fadeIn(ms.stand, 0.3f);

            ms.stand.speed = stance.getMotionSpeed(this);
        };

        action.last = () =>
        {
        };
    }
Beispiel #8
0
    // アクション ================================================================================

    // stay ----------------------------------------------------


    void stay(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(staying);

            state.setPhysics(physStayOnWall);
            posture.setCollision(collisionWallInStay);


            migration.setTimer(mode.isBattling ? 0.0f : Random.Range(0.0f, 3.0f));



            move.setRepairTime(1.5f);

            stance.setActionSpeed(1.0f);

            motion.fadeIn(ms.stand, 0.3f);

            ms.stand.speed = stance.getMotionSpeed(this);


            posture.fittingRate = 30.0f;
        };

        action.last = () =>
        {
            posture.fittingRate = 3.0f;
        };
    }
Beispiel #9
0
    // damaging ----------------------------------------------------

    void damage(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(damaging);

            //state.setPhysics( physStayOnWall );
            //setPhysicsStayMode();
            //shiftToPhysicalMode();

            posture.setCollision(collisionWallInStay);


            // 復帰スピードは move による。回復値は元のモーションのものとなる。


            wriggler.off();

            motion.fadeIn(ms.damage, 0.2f);

            ms.damage.speed = 2.0f * def.quickness * figure.scaleRateR;
        };

        action.last = () =>
        {
            //shiftToPhysicalMode();
        };
    }
Beispiel #10
0
    // アクション ==============================================================================



    // walk ------------------------------------------------------------------

    void walk(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(walking);

            state.setPhysics(physHitCheckWall);


            changeToStand();

            motion.crossFade(msStandStance, 0.1f);


            msNowWaponUpperStance = msWaponUpperStance;

            motionUpperBody.fadeIn(msNowWaponUpperStance, 0.1f);


            output.set(1.0f, 1.0f, 1.0f, 1.0f, 0.0f);
        };

        action.last = () =>
        {
        };
    }
Beispiel #11
0
    // walk ----------------------------------------------------

    void walk(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(walking);


            state.setPhysics(physMoveOnWall);
            posture.setCollision(collisionWallInMove);

            move.setRepairTime(1.0f);


            if (mode.isWait)
            {
                migration.setTargetPoint(this);
            }


            motion.fadeIn(mode.isDecisionEnemy ? ms.walkAnger : ms.walk, 0.3f);
        };

        action.last = () =>
        {
        };
    }
Beispiel #12
0
    // sliding ------------------------------------------------------

    void slide(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(sliding);

            state.setPhysics(physHitCheckWall);


            motion.crossFade(msSitdown, 0.1f);

            changeToCrawl();



            //move._inc( 20.0f, 30.0f );//30.0f, 20.0f );// * stamina.get() );

            rb.AddForce(stance.direction * move.speedRate01 * 80.0f, ForceMode.Impulse);



            upperStanceToWapon();



            output.set(1.0f, 5.0f, 1.0f, 1.0f, 0.0f);
        };

        action.last = () =>
        {
        };
    }
Beispiel #13
0
    // attack ----------------------------------------------------

    void attack(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(attacking);


            //state.setPhysics( physStayOnWall );
            //setPhysicsStayMode();

            posture.setCollision(collisionWallInStay);


            move.setRepairPowerRate(0.0f);



            motion.fadeIn(ms.attack, 0.3f);
            //anim.CrossFade( ms.attack.name, 0.3f );

            ms.attack.speed = stance.getMotionSpeed(this);
        };

        action.last = () =>
        {
            move.setRepairTime(2.0f);
        };
    }
Beispiel #14
0
    // dead -------------------------------------------------------

    void dead(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(deadingStay);


            state.setPhysics(physFree);
            shiftToPhysicalMode();
            posture.setCollision(null);


            move.setRepairPowerRate(0.0f);
            stance.setSpeedZero();


            wriggler.turnOnly();

            motion.fadeIn(ms.dead, 0.3f);
            //anim.CrossFade( ms.dead.name, 0.3f );


            migration.setTimer(30.0f);


            rb.constraints = RigidbodyConstraints.None;



            figure.moveCollider.enabled = false;

            rb.isKinematic = false;


            switchEnvelopeDeadOrArive(UserLayer._enemyEnvelope, UserLayer._enemyEnvelopeDead);


            deadize();
        };

        action.last = () =>
        {
            //shiftToPhysicalMode();


            rb.detectCollisions = true;

            switchEnvelopeDeadOrArive(UserLayer._enemyEnvelopeDead, UserLayer._enemyEnvelope);

            rb.constraints = figure.rbDefaultConstraints;

            //shiftToPhysicalMode();


            final();
        };
    }
Beispiel #15
0
    void roll(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(rolling);

            state.setPhysics(physHitCheckWall);


            motion.crossFade(msRoll, 0.1f);

            changeToStand();

            physMats.change(figure.currentCollider, physMats.rolling);


            msNowWaponUpperStance = null;

            motionUpperBody.fadeOut(0.1f);


            isMoveHeadInFps = false;

            isAvoiding = true;

            isSmallDash = false;


            playerShoot.available -= ShootOpenFlag.shoot;

            msRoll.speed = 1.7f;            //2.0f;


            move.setRepairPowerRate(0.0f);

            output.set(1.0f, 3.0f, 1.0f, 1.0f, 0.0f);
        };

        action.last = () =>
        {
            physMats.change(figure.currentCollider, physMats.stand);

            isMoveHeadInFps = true;

            isAvoiding = false;


            playerShoot.available += ShootOpenFlag.shoot;

            //msRoll.speed = 0.0f;

            //msRoll.time = msRoll.length;
        };
    }
Beispiel #16
0
    // avoidance & rolling ------------------------------------------------------

    void avoidance(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(avoidancing);

            state.setPhysics(physHitCheckWall);


            motion.crossFade(msDash, 0.1f);

            changeToStand();

            physMats.change(figure.currentCollider, physMats.dash);



            //var dashForce = ( !isSmallDash ? 1000.0f : 600.0f ) * move.sqSpeedRate01;

            //rb.AddForce( stance.direction * dashForce + Vector3.up * 35.0f, ForceMode.Impulse );



            msNowWaponUpperStance = null;

            motionUpperBody.fadeOut(0.1f);


            isMoveHeadInFps = false;

            isAvoiding = true;

            playerShoot.available -= ShootOpenFlag.shoot;


            move.setRepairPowerRate(0.0f);

            output.set(1.0f, 5.0f, 1.0f, 1.0f, 0.0f);
        };

        action.last = () =>
        {
            physMats.change(figure.currentCollider, physMats.stand);

            isMoveHeadInFps = true;

            isAvoiding = false;

            playerShoot.available += ShootOpenFlag.shoot;

            //if( GamePad.l1 ) rb.AddForce( stance.direction * -300.0f, ForceMode.Impulse );
        };
    }
Beispiel #17
0
    // dead -------------------------------------------------------

    void dead(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(deading);

            state.setPhysics(physFree);

            figure.changeCollider(EnStance.crawl);


            changeToCrawl();

            motion.crossFade(msDead, 0.5f);


            msNowWaponUpperStance = null;

            motionUpperBody.fadeOut(0.3f);



            move.setRepairPowerRate(0.0f);

            move.setSpeedRate(0.0f);

            stance.direction = rb.rotation * Vector3.forward;


            isRunable = false;

            playerShoot.available <<= ShootOpenFlag.notable;


            output.set(0.5f, 0.0f, 0.5f, 1.0f, 0.0f);


            deadize();
        };

        action.last = () =>
        {
            figure.changeCollider(EnStance.stand);


            isRunable = true;

            playerShoot.available <<= ShootOpenFlag.playerReady;

            ragdoll.switchToAnimation();
        };
    }
    // dead -------------------------------------------------------

    void dead(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(deadingStay);


            state.setPhysics(physFree);
            posture.setCollision(null);
            shiftToPhysicalMode();


            moveSpeed.set(0.0f);


            motion.fadeIn(msDead, 0.3f);


            releaseTime = Time.time + 30.0f;


            rb.constraints = RigidbodyConstraints.None;



            figure.moveCollider.enabled = false;

            rb.isKinematic = false;

            switchEnvelopeDeadOrArive(UserLayer._enemyEnvelope, UserLayer._enemyEnvelopeDead);


            deadize();
        };

        action.last = () =>
        {
            shiftToPhysicalMode();


            rb.detectCollisions = true;

            switchEnvelopeDeadOrArive(UserLayer._enemyEnvelopeDead, UserLayer._enemyEnvelope);

            rb.constraints = figure.rbDefaultConstraints;


            final();
        };
    }
Beispiel #19
0
    // locomote -----------------------------

    void locomote(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(locomoting);

            state.setPhysics(physFree);
            posture.setCollision(null);
        };

        action.last = () =>
        {
        };
    }
Beispiel #20
0
    void run(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(running);

            state.setPhysics(physHitCheckWall);

            motion.crossFade(msWalkStance, 0.1f);

            changeToStand();

            /*
             * if( stance.direction.sqrMagnitude == 0.0f )
             * {
             *      stance.direction = rb.rotation * Vector3.forward;
             * }
             */
            move.setSpeedRate(Mathf.Min(move.speedRate, runSpeed));

            move.setRepairTime(3.0f);



            msNowWaponUpperStance = null;

            motionUpperBody.fadeOut(0.2f);


            isRunable = false;

            //playerShoot.isShootable = false;
            playerShoot.available -= ShootOpenFlag.shoot;


            output.set(1.0f, 2.0f, 1.0f, 1.0f, 0.0f);
        };

        action.last = () =>
        {
            isRunable = true;

            //playerShoot.isShootable = true;
            playerShoot.available += ShootOpenFlag.shoot;


            msWalkStance.speed = 1.0f;
        };
    }
Beispiel #21
0
    // dead -------------------------------------------------------

    void dead(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(deadingStay);


            state.setPhysics(physFree);
            shiftToPhysicalMode();
            posture.setCollision(null);


            //move.velocity = 0.0f;



            migration.setTimer(30.0f);


            rb.constraints = RigidbodyConstraints.None;



            figure.moveCollider.enabled = false;

            rb.isKinematic = false;


            //switchEnvelopeDeadOrArive( UserLayer._enemyEnvelope, UserLayer._enemyEnvelopeDead );


            deadize();
        };

        action.last = () =>
        {
            rb.detectCollisions = true;

            //switchEnvelopeDeadOrArive( UserLayer._enemyEnvelopeDead, UserLayer._enemyEnvelope );

            rb.constraints = figure.rbDefaultConstraints;


            final();
            structure.destruct();
        };
    }
Beispiel #22
0
    // crawl ------------------------------------------------------------------

    void crawl(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(crawling);

            state.setPhysics(physHitCheckWall);


            motion.crossFade(msCrawl, 0.2f);

            changeToCrawl();

            figure.changeCollider(EnStance.crawl);


            // 暫定ずらし 本来はアニメーションを調整すべき
            var newBody = tfBody.localPosition;
            newBody.z            = -0.24f;
            tfBody.localPosition = newBody;


            msNowWaponUpperStance = msWaponCrawlUpperStance;

            //motionUpperBody.play( msNowWaponUpperStance );
            //motionUpperBody.crossFade( msNowWaponUpperStance, 0.1f );


            output.set(1.0f, 1.0f, 1.0f, 1.0f, 0.0f);
        };

        action.last = () =>
        {
            figure.changeCollider(EnStance.stand);


            // 暫定ずらし 本来はアニメーションを調整すべき
            var newBody = tfBody.localPosition;
            newBody.z            = 0.0f;
            tfBody.localPosition = newBody;


            Destroy(jtHang);          //
            jtHang = null;            //
        };
    }
Beispiel #23
0
    // land -------------------------------------------------------

    void land(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            motion.crossFade(msLanding, 0.2f);
            //motion.crossFade( msKneesit, 0.2f );

            figure.changeCollider(EnStance.crawl);


            state.shiftTo(landing);

            state.setPhysics(physFree);              // physHitCheckWall );


            //changeToStand();
            changeToCrawl();

            if (stance.direction.sqrMagnitude == 0.0f)
            {
                stance.direction = rb.rotation * Vector3.forward;
            }


            msNowWaponUpperStance = null;

            motionUpperBody.fadeOut(0.2f);


            isRunable = false;

            playerShoot.available -= ShootOpenFlag.shoot;

            output.set(1.0f, 3.0f, 1.0f, 1.0f, 0.0f);
        };

        action.last = () =>
        {
            figure.changeCollider(EnStance.stand);


            isRunable = true;

            playerShoot.available += ShootOpenFlag.shoot;
        };
    }
Beispiel #24
0
    /*
     * protected void turnToQuarterFront()
     * {
     *
     *      //var t = new Vector2( migration.targetPoint.x, mig
     *
     * }
     */

    // アクション ================================================================================

    // stay ----------------------------------------------------

    void stay(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(staying);


            //collisionProc = collisionWallInStay;


            motion.fadeIn(ms.stand, 1.5f);

            //msStand.speed = quickness * figure.scaleRateR;
        };

        action.last = () =>
        {
        };
    }
    // walk ----------------------------------------------------

    void walk(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(walking);


            //state.setPhysics( physMoveOnWall );

            posture.setCollision(collisionWallInMove);


            releaseTime = 0.0f;
        };

        action.last = () =>
        {
        };
    }
Beispiel #26
0
    // walk --------------------------------------------------

    void walk(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(walking);


            motion.fadeIn(ms.walk, 0.5f);

            //msStand.speed = quickness * figure.scaleRateR;


            rollUpBeamTentacles(2000.0f, 1000.01f);
        };

        action.last = () =>
        {
            rollDownBeamTentacles(1000.0f);
        };
    }
    // damaging ----------------------------------------------------

    void damage(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(damaging);

            //state.setPhysics( physStayOnWall );
            //setPhysicsStayMode();

            posture.setCollision(collisionWallInStay);


            motion.fadeIn(msDamage, 0.2f);

            msDamage.speed = def.quickness * figure.scaleRateR;
        };

        action.last = () =>
        {
        };
    }
Beispiel #28
0
    // attack ------------------------------------------------

    void attack(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            se.cryOut();


            msFireNow = Random.value > 0.5f ? ms.fireH : ms.fireV;

            state.shiftTo(attacking);

            motion.fadeIn(msFireNow, 1.0f);


            //msStand.speed = quickness * figure.scaleRateR;
        };

        action.last = () =>
        {
        };
    }
Beispiel #29
0
    // blowing ----------------------------------------------------

    void blow(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            state.shiftTo(browing);


            //motion.crossFade( msWalk, 0.2f );//msDamage, 0.2f );

            //msDamage.speed = quickness * figure.scaleRateR;


            //rb.constraints = RigidbodyConstraints.None;
        };

        action.last = () =>
        {
            setKinematicFullBody(true);

            //rb.constraints = rbDefaultConstraints;
        };
    }
Beispiel #30
0
    // walk --------------------------------------------------

    void walk(ref ActionStateUnit.ActionHolder action)
    {
        action.first = () =>
        {
            se.garuruOut();

            state.shiftTo(walking);


            motion.fadeIn(ms.walk, 1.0f);

            msWalkNow = ms.walk;

            msWalkNow.speed = 0.3f * def.quickness * figure.scaleRateR;


            //setTailAnimation( msWalkNow, Random.value > 0.5f );
        };

        action.last = () =>
        {
        };
    }