A 2D Farming RPG
This is just a simple 2D farming RPG game
Loading...
Searching...
No Matches
Player Class Reference

This class has all the things related to player More...

Inheritance diagram for Player:
Inheritance graph
Collaboration diagram for Player:
Collaboration graph

Public Member Functions

void DisablePlayerInputAndResetMovement ()
 Disable input and reset movement. More...
 
void DisablePlayerInput ()
 Disable Player Input More...
 
void EnablePlayerInput ()
 Enable Player Input More...
 
void ClearCarriedItem ()
 Clear the carry animation More...
 
void ShowCarriedItem (int itemCode)
 Show the carried item. More...
 
Vector3 GetPlayerViewportPosition ()
 Check the player position in the gameworld. More...
 

Properties

bool PlayerInputIsDisabled [get, set]
 
- Properties inherited from SingletonMonobehaviour< Player >
static T Instance [get]
 

Private Member Functions

void Awake ()
 Initialize members More...
 
void Start ()
 Initialize grid cursor variable. More...
 
void Update ()
 Handle movement inputs and publish animation events. More...
 
void FixedUpdate ()
 Handle player movements. More...
 
void PlayerMovement ()
 Calculate player movements. More...
 
void ResetAnimatioTriggers ()
 Reset the animation triggers. More...
 
void PlayerMovementInput ()
 Handle player inputs and normalized that. More...
 
void PlayerWalkInput ()
 Handle player walk inputs. More...
 
void PlayerClickInput ()
 If the grid cursor is enabled and player click left mouse button call ProcessPlayerClickInput() More...
 
void ProcessPlayerClickInput ()
 
void ProcessPlayerClickInputSeed (ItemDetails itemDetails)
 Check the position is valid and the item can be dropped for seed. More...
 
void ProcessPlayerClickInputCommodity (ItemDetails itemDetails)
 Check the position is valid and the item can be dropped for commodity. More...
 
void PlayerTestInput ()
 TODO: Remove before final product. More...
 
void ResetMovement ()
 Reset Movement More...
 

Private Attributes

AnimationOverrides m_AnimationOverrides
 
GridCursor m_GridCursor
 
float m_XInput
 
float m_YInput
 
bool m_IsWalking
 
bool m_IsRunning
 
bool m_IsIdle
 
bool m_IsCarrying = false
 
bool m_IsUsingToolRight
 
bool m_IsUsingToolLeft
 
bool m_IsUsingToolUp
 
bool m_IsUsingToolDown
 
bool m_IsLiftingToolRight
 
bool m_IsLiftingToolLeft
 
bool m_IsLiftingToolUp
 
bool m_IsLiftingToolDown
 
bool m_IsSwingingToolRight
 
bool m_IsSwingingToolLeft
 
bool m_IsSwingingToolUp
 
bool m_IsSwingingToolDown
 
bool m_IsPickingRight
 
bool m_IsPickingLeft
 
bool m_IsPickingUp
 
bool m_IsPickingDown
 
ToolEffect m_ToolEffect = ToolEffect.NONE
 
Camera m_MainCamera
 
Rigidbody2D m_RigidBody2D
 
Direction m_PlayerDirection
 
List< CharacterAttributem_CharacterAttributeCustomisationList
 
float m_MovementSpeed
 
SpriteRenderer m_EquippedItemSpriteRenderer = null
 
CharacterAttribute m_ArmsCharacterAttribute
 
CharacterAttribute m_ToolCharacterAttribute
 
bool m_PlayerInputIsDisabled = false
 

Additional Inherited Members

virtual void Awake ()
 

Detailed Description

This class has all the things related to player

Definition at line 7 of file Player.cs.

Member Function Documentation

◆ Awake()

void Player.Awake ( )
inlineprivatevirtual

Initialize members

Reimplemented from SingletonMonobehaviour< Player >.

Definition at line 67 of file Player.cs.

◆ ClearCarriedItem()

void Player.ClearCarriedItem ( )
inline

Clear the carry animation

Definition at line 393 of file Player.cs.

Here is the call graph for this function:

◆ DisablePlayerInput()

void Player.DisablePlayerInput ( )
inline

Disable Player Input

Definition at line 377 of file Player.cs.

Here is the caller graph for this function:

◆ DisablePlayerInputAndResetMovement()

void Player.DisablePlayerInputAndResetMovement ( )
inline

Disable input and reset movement.

Definition at line 358 of file Player.cs.

Here is the call graph for this function:

◆ EnablePlayerInput()

void Player.EnablePlayerInput ( )
inline

Enable Player Input

Definition at line 385 of file Player.cs.

◆ FixedUpdate()

void Player.FixedUpdate ( )
inlineprivate

Handle player movements.

Definition at line 131 of file Player.cs.

Here is the call graph for this function:

◆ GetPlayerViewportPosition()

Vector3 Player.GetPlayerViewportPosition ( )
inline

Check the player position in the gameworld.

Returns

Definition at line 434 of file Player.cs.

◆ PlayerClickInput()

void Player.PlayerClickInput ( )
inlineprivate

If the grid cursor is enabled and player click left mouse button call ProcessPlayerClickInput()

Definition at line 243 of file Player.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PlayerMovement()

void Player.PlayerMovement ( )
inlineprivate

Calculate player movements.

Definition at line 139 of file Player.cs.

Here is the caller graph for this function:

◆ PlayerMovementInput()

void Player.PlayerMovementInput ( )
inlineprivate

Handle player inputs and normalized that.

Definition at line 172 of file Player.cs.

Here is the caller graph for this function:

◆ PlayerTestInput()

void Player.PlayerTestInput ( )
inlineprivate

TODO: Remove before final product.

Advance time just for the sake of testing.

Definition at line 322 of file Player.cs.

Here is the caller graph for this function:

◆ PlayerWalkInput()

void Player.PlayerWalkInput ( )
inlineprivate

Handle player walk inputs.

Definition at line 221 of file Player.cs.

Here is the caller graph for this function:

◆ ProcessPlayerClickInput()

void Player.ProcessPlayerClickInput ( )
inlineprivate

Definition at line 257 of file Player.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessPlayerClickInputCommodity()

void Player.ProcessPlayerClickInputCommodity ( ItemDetails  itemDetails)
inlineprivate

Check the position is valid and the item can be dropped for commodity.

Parameters
itemDetails

Definition at line 310 of file Player.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessPlayerClickInputSeed()

void Player.ProcessPlayerClickInputSeed ( ItemDetails  itemDetails)
inlineprivate

Check the position is valid and the item can be dropped for seed.

Parameters
itemDetails

Definition at line 298 of file Player.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResetAnimatioTriggers()

void Player.ResetAnimatioTriggers ( )
inlineprivate

Reset the animation triggers.

Definition at line 148 of file Player.cs.

Here is the caller graph for this function:

◆ ResetMovement()

void Player.ResetMovement ( )
inlineprivate

Reset Movement

Definition at line 346 of file Player.cs.

Here is the caller graph for this function:

◆ ShowCarriedItem()

void Player.ShowCarriedItem ( int  itemCode)
inline

Show the carried item.

Parameters
itemCode

Definition at line 411 of file Player.cs.

Here is the call graph for this function:

◆ Start()

void Player.Start ( )
inlineprivate

Initialize grid cursor variable.

Definition at line 87 of file Player.cs.

◆ Update()

void Player.Update ( )
inlineprivate

Handle movement inputs and publish animation events.

Definition at line 96 of file Player.cs.

Here is the call graph for this function:

Field Documentation

◆ m_AnimationOverrides

AnimationOverrides Player.m_AnimationOverrides
private

Definition at line 9 of file Player.cs.

◆ m_ArmsCharacterAttribute

CharacterAttribute Player.m_ArmsCharacterAttribute
private

Definition at line 53 of file Player.cs.

◆ m_CharacterAttributeCustomisationList

List<CharacterAttribute> Player.m_CharacterAttributeCustomisationList
private

Definition at line 45 of file Player.cs.

◆ m_EquippedItemSpriteRenderer

SpriteRenderer Player.m_EquippedItemSpriteRenderer = null
private

Definition at line 50 of file Player.cs.

◆ m_GridCursor

GridCursor Player.m_GridCursor
private

Definition at line 10 of file Player.cs.

◆ m_IsCarrying

bool Player.m_IsCarrying = false
private

Definition at line 18 of file Player.cs.

◆ m_IsIdle

bool Player.m_IsIdle
private

Definition at line 17 of file Player.cs.

◆ m_IsLiftingToolDown

bool Player.m_IsLiftingToolDown
private

Definition at line 26 of file Player.cs.

◆ m_IsLiftingToolLeft

bool Player.m_IsLiftingToolLeft
private

Definition at line 24 of file Player.cs.

◆ m_IsLiftingToolRight

bool Player.m_IsLiftingToolRight
private

Definition at line 23 of file Player.cs.

◆ m_IsLiftingToolUp

bool Player.m_IsLiftingToolUp
private

Definition at line 25 of file Player.cs.

◆ m_IsPickingDown

bool Player.m_IsPickingDown
private

Definition at line 34 of file Player.cs.

◆ m_IsPickingLeft

bool Player.m_IsPickingLeft
private

Definition at line 32 of file Player.cs.

◆ m_IsPickingRight

bool Player.m_IsPickingRight
private

Definition at line 31 of file Player.cs.

◆ m_IsPickingUp

bool Player.m_IsPickingUp
private

Definition at line 33 of file Player.cs.

◆ m_IsRunning

bool Player.m_IsRunning
private

Definition at line 16 of file Player.cs.

◆ m_IsSwingingToolDown

bool Player.m_IsSwingingToolDown
private

Definition at line 30 of file Player.cs.

◆ m_IsSwingingToolLeft

bool Player.m_IsSwingingToolLeft
private

Definition at line 28 of file Player.cs.

◆ m_IsSwingingToolRight

bool Player.m_IsSwingingToolRight
private

Definition at line 27 of file Player.cs.

◆ m_IsSwingingToolUp

bool Player.m_IsSwingingToolUp
private

Definition at line 29 of file Player.cs.

◆ m_IsUsingToolDown

bool Player.m_IsUsingToolDown
private

Definition at line 22 of file Player.cs.

◆ m_IsUsingToolLeft

bool Player.m_IsUsingToolLeft
private

Definition at line 20 of file Player.cs.

◆ m_IsUsingToolRight

bool Player.m_IsUsingToolRight
private

Definition at line 19 of file Player.cs.

◆ m_IsUsingToolUp

bool Player.m_IsUsingToolUp
private

Definition at line 21 of file Player.cs.

◆ m_IsWalking

bool Player.m_IsWalking
private

Definition at line 15 of file Player.cs.

◆ m_MainCamera

Camera Player.m_MainCamera
private

Definition at line 37 of file Player.cs.

◆ m_MovementSpeed

float Player.m_MovementSpeed
private

Definition at line 47 of file Player.cs.

◆ m_PlayerDirection

Direction Player.m_PlayerDirection
private

Definition at line 42 of file Player.cs.

◆ m_PlayerInputIsDisabled

bool Player.m_PlayerInputIsDisabled = false
private

Definition at line 56 of file Player.cs.

◆ m_RigidBody2D

Rigidbody2D Player.m_RigidBody2D
private

Definition at line 39 of file Player.cs.

◆ m_ToolCharacterAttribute

CharacterAttribute Player.m_ToolCharacterAttribute
private

Definition at line 54 of file Player.cs.

◆ m_ToolEffect

ToolEffect Player.m_ToolEffect = ToolEffect.NONE
private

Definition at line 35 of file Player.cs.

◆ m_XInput

float Player.m_XInput
private

Definition at line 13 of file Player.cs.

◆ m_YInput

float Player.m_YInput
private

Definition at line 14 of file Player.cs.

Property Documentation

◆ PlayerInputIsDisabled

bool Player.PlayerInputIsDisabled
getset

Definition at line 58 of file Player.cs.


The documentation for this class was generated from the following file: