mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-26 05:50:18 +00:00
extract method
This commit is contained in:
parent
7f6ca3f4aa
commit
aba5c41ffd
4 changed files with 25 additions and 13 deletions
|
@ -95,14 +95,7 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
||||||
// if( !this.IsActiveState )
|
// if( !this.IsActiveState )
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
// we need to adjust local position of some bones - root frame needs to be 0.5 units below the ped
|
CrouchState.AdjustRootFramePosition(m_ped);
|
||||||
|
|
||||||
// for some reason, y position always remains 0.25
|
|
||||||
// m_model.UnnamedFrame.transform.localPosition = m_model.UnnamedFrame.transform.localPosition.WithXAndZ();
|
|
||||||
|
|
||||||
Vector3 pos = m_model.RootFrame.transform.localPosition;
|
|
||||||
pos.y = -0.5f - m_model.UnnamedFrame.transform.localPosition.y;
|
|
||||||
m_model.RootFrame.transform.localPosition = pos;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,21 @@ namespace SanAndreasUnity.Behaviours.Peds.States
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void AdjustRootFramePosition(Ped ped)
|
||||||
|
{
|
||||||
|
// we need to adjust local position of some bones - root frame needs to be 0.5 units below the ped
|
||||||
|
|
||||||
|
var model = ped.PlayerModel;
|
||||||
|
|
||||||
|
// for some reason, y position always remains 0.25
|
||||||
|
// m_model.UnnamedFrame.transform.localPosition = m_model.UnnamedFrame.transform.localPosition.WithXAndZ();
|
||||||
|
|
||||||
|
Vector3 pos = model.RootFrame.transform.localPosition;
|
||||||
|
pos.y = -0.5f - model.UnnamedFrame.transform.localPosition.y;
|
||||||
|
model.RootFrame.transform.localPosition = pos;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public override void OnJumpPressed ()
|
public override void OnJumpPressed ()
|
||||||
{
|
{
|
||||||
// switch to stand state
|
// switch to stand state
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
|
|
||||||
- sometimes, current vehicle is null on client
|
- sometimes, current vehicle is null on client
|
||||||
|
|
||||||
- play horn sound ?
|
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
- is weapon sound 3d ?
|
- is weapon sound 3d ?
|
||||||
|
|
12
Docs/TODO.md
12
Docs/TODO.md
|
@ -20,15 +20,21 @@
|
||||||
|
|
||||||
- Does 'O' button changes quality level ?
|
- Does 'O' button changes quality level ?
|
||||||
|
|
||||||
- Check how much RAM textures use
|
- **Check how much RAM textures use ; don't load them on headless server ;**
|
||||||
|
|
||||||
- Map window: draw vehicles ;
|
- **When model is changed for a passenger, his position is moved to start of anim** ;
|
||||||
|
|
||||||
|
- **Are weapon audio clips unloaded ?**
|
||||||
|
|
||||||
|
- Map window: **draw vehicles** ;
|
||||||
|
|
||||||
|
- Play sounds: horn ; empty weapon slot ; ped damage ; footsteps in run and sprint states ;
|
||||||
|
|
||||||
- Script execution order: HUD before pause menu and windows ; fps counter after all ;
|
- Script execution order: HUD before pause menu and windows ; fps counter after all ;
|
||||||
|
|
||||||
- Add option to change fixed delta time ?
|
- Add option to change fixed delta time ?
|
||||||
|
|
||||||
- Crouching: adjust camera aim offset ? ; adjust height offset of ped ;
|
- Crouching: adjust camera aim offset ? ; **adjust height offset of ped - only state that needs to do this is CrouchState** ;
|
||||||
|
|
||||||
- Optimize Console.Update() - don't do trim excess for every log message
|
- Optimize Console.Update() - don't do trim excess for every log message
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue