DiscreteStep(int Action_)
        {
            base.DiscreteStep(Action_);
            switch (Action_)
            {
            case Backward:
                Player.GetComponentInChildren <Rigidbody>().AddForce((new Vector3(0, 0,
                                                                                  -MoveAccumulator.getCurrent())));
                break;

            case Forward:
                Player.GetComponentInChildren <Rigidbody>().AddForce((new Vector3(0, 0,
                                                                                  MoveAccumulator.getCurrent())));
                break;

            case Right:
                Player.GetComponentInChildren <Rigidbody>().AddForce((new Vector3(
                                                                          MoveAccumulator.getCurrent(), 0, 0)));
                break;

            case Left:
                Player.GetComponentInChildren <Rigidbody>().AddForce((new Vector3(
                                                                          -MoveAccumulator.getCurrent(), 0, 0)));
                break;

            default:
                break;
            }
        }
Exemple #2
0
        DiscreteStep(int Action_)
        {
            base.DiscreteStep(Action_);

            switch (Action_)
            {
            case Forward:
                for (int i = 0; i < NumBulletPerRelease; i++)
                {
                    GameObject Temp_Bullet_Handeler;
                    Temp_Bullet_Handeler = Instantiate(Bullet, Bullet_Emitter.transform.position,
                                                       Bullet_Emitter.transform.rotation) as GameObject;
                    var vs =
                        Vector3.Normalize(Vector3.Slerp((Bullet_EmitterLeftEdge.transform.position
                                                         - Bullet_Emitter.transform.position),
                                                        (Bullet_EmitterRightEdge.transform.position - Bullet_Emitter.transform.position),
                                                        Random.value));
                    Temp_Bullet_Handeler.GetComponent <Rigidbody>().velocity = vs * 10f;
                    Destroy(Temp_Bullet_Handeler, 3.0f);
                }
                Player.GetComponentInChildren <Rigidbody>().AddForce(Player.transform.TransformVector(
                                                                         Vector3.forward * 40f));
                Player.GetComponentInChildren <Rigidbody>().angularVelocity = Vector3.zero;
                break;

            default:
                break;
            }
        } // Step
        DiscreteStep(int Action_)
        {
            base.DiscreteStep(Action_);
            switch (Action_)
            {
            case NoAction:
                Player.GetComponentInChildren <Rigidbody>().velocity = Vector3.zero;
                break;

            default:
                break;
            }
        }