Ejemplo n.º 1
0
    private void CreateNetwork()
    {
        dead     = new PlayerDead(this);
        walking  = new PlayerWalking(this);
        jumping  = new PlayerJumping(jumpBufferTime, this);
        rising   = new PlayerRising(this);
        falling  = new PlayerFalling(this);
        flipping = new PlayerFlipping(flipTime, flipOffset, this);

        walking.AddTransition(dead);
        walking.AddTransition(jumping);
        walking.AddTransition(rising);
        walking.AddTransition(falling);
        walking.AddTransition(flipping);

        jumping.AddTransition(dead);
        jumping.AddTransition(walking);
        jumping.AddTransition(rising);
        jumping.AddTransition(falling);
        jumping.AddTransition(flipping);

        rising.AddTransition(dead);
        rising.AddTransition(walking);
        rising.AddTransition(falling);
        rising.AddTransition(flipping);

        falling.AddTransition(dead);
        falling.AddTransition(walking);
        falling.AddTransition(rising);

        flipping.AddTransition(walking);
        flipping.AddTransition(falling);

        activeState = walking;
    }
Ejemplo n.º 2
0
 private void Start()
 {
     playerIdle      = GetComponent <PlayerIdle>();
     playerWalking   = GetComponent <PlayerWalking>();
     playerCrouching = GetComponent <PlayerCrouching>();
     playerJumping   = GetComponent <PlayerJumping>();
 }
Ejemplo n.º 3
0
 // Start is called before the first frame update
 void Start()
 {
     playerStats = GetComponent <PlayerWalking>(); // instantiate PlayerStats as the PlayerWalking script
     inCover     = false;
     // filter = filter.NoFilter(); // sets the Contact Filter to No Filter
     // coverList = new Collider2D[4];
 }
Ejemplo n.º 4
0
    // Start is called before the first frame update
    void Start()
    {
        m_cam = Camera.main;

        walkingState  = new PlayerWalking(this, transform, m_moveSpeed, m_cam, m_maxClimbEnterAngle, GetComponent <Rigidbody>(), m_normalOffset);
        climbingState = new PlayerClimbingNew(this, transform, m_moveSpeed, m_cam, m_maxLerpCheck, GetComponent <Rigidbody>(), m_jumpVisual, m_maxClimbEnterAngle, m_normalOffset,
                                              m_maxClimbAroundWallOuterAngle, m_maxClimbAroundWallInnerAngle, m_freelookCam);
        m_currentState = walkingState;
        m_currentState.Init();
    }
 private Vector3 peekTarget; // point where the camera should move when peeking
 // Start is called before the first frame update
 void Start()
 {
     pw = playerCopy.GetComponent <PlayerWalking>();
 }
Ejemplo n.º 6
0
 private void Start()
 {
     player = GetComponentInChildren <PlayerWalking>();
 }
Ejemplo n.º 7
0
 private void Start()
 {
     anim     = GetComponentInChildren <Animator>();
     player   = FindObjectOfType <PlayerWalking>();
     speakers = GetComponentInChildren <AudioSource>();
 }