-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Character Animation #669
Character Animation #669
Conversation
@@ -57,10 +57,24 @@ public void OnCharacterCreated(Character c) | |||
char_go.transform.SetParent(characterParent.transform, true); | |||
|
|||
SpriteRenderer sr = char_go.AddComponent<SpriteRenderer>(); | |||
sr.sprite = SpriteManager.current.GetSprite("Character", "p2_front"); | |||
//sr.sprite = SpriteManager.current.GetSprite("Character", "p2_front"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not be commented out code
You should run StyleCop, looks like there are some issues. (For example to many empty lines) |
Commented line is removed, and I ran StyleCop on CharacterAnimation. |
It is probably the best for clean up to be performed separately, it can be snuck through when nobody working on the file, harmlessly. |
@@ -329,7 +338,7 @@ private bool CheckForJobMaterials() | |||
// Walk towards a tile containing the required goods. | |||
Debug.Log("Walk to the stuff"); | |||
Debug.Log(myJob.canTakeFromStockpile); | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Theres a handful of lines in this file with trailing white space. Could you fix that? :)
@Mizipzor I removed the whitespace now. |
public bool IsWalking; | ||
|
||
// 0=north, 1=east, 2=south, 3=west | ||
public int Facing; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should use an enum here. It would make things look more clear.
This is "just" a refactor, right? The character should be equally animated before and after this is merged? |
@Mizipzor Uhm, what do you mean? The character wasn't animated before |
should work with #684 |
I couldve sworn my character was animated before I tested this. I might be crazy, let me have another look. |
Nope, he wasnt. Either I was running with your changes when I thought I wasnt, or I'm actually crazy. Good work on the enum though, I would've asked for that as well. :) Good job! |
* Fixed position of sprite tiles. Now Y positions are counted from the bottom up. * Added CharacterAnimation class and hooked it up to character and characterspritecontroller * Character animation working * Ran stylecop on CharacterAnimation * Removed whitespace * Changed facing from int to Enum
Added a CharacterAnimation class, and hooked it up to Character and CharacterSpriteController.
The helmet is still a seperate sprite, so only the character is animated.
See issue #142