Ejemplo n.º 1
0
            void SetDelta(ref CharaDelta charaDelta, int _delta, EnumMoveMuki _moveMuki)
            {
                var delta = DeltaToVector3Int(_delta, _moveMuki);

                charaDelta.m_deltaX = delta.x;
                charaDelta.m_deltaY = delta.y;
                charaDelta.m_deltaZ = delta.z;
            }
Ejemplo n.º 2
0
            void UpdateGravity(ref CharaDelta charaDelta, ref CharaFlag charaFlag, int gravity)
            {
                charaDelta.m_deltaY -= gravity;

                if (!charaFlag.m_mapFlag.IsFlag(FlagMapCheck.Land) &&
                    charaDelta.m_deltaY < 0)
                {
                    charaFlag.m_mapFlag.AddFlag(FlagMapCheck.Land);
                }
            }
Ejemplo n.º 3
0
            public void Execute()
            {
                for (int i = 0; i < m_charaPoses.Length; i++)
                {
                    CharaPos   charaPoses = m_charaPoses[i];
                    CharaDelta charaDelta = m_charaDeltas[i];
                    Vector3Int pos        = new Vector3Int(
                        charaPoses.m_posX + charaDelta.m_deltaX,
                        charaPoses.m_posY + charaDelta.m_deltaY,
                        charaPoses.m_posZ + charaDelta.m_deltaZ);

                    // Debug.Log($" charaPoses.m_posX: {charaPoses.m_posX}");
                    charaPoses.SetPosition(pos);
                    m_charaPoses[i] = charaPoses;
                }
            }
Ejemplo n.º 4
0
            void UpdateFriction(ref CharaDelta charaDelta, int brakeDelta)
            {
                if (charaDelta.m_deltaX > 0)
                {
                    charaDelta.m_deltaX = Mathf.Min(0, charaDelta.m_deltaX - brakeDelta);
                }
                else if (charaDelta.m_deltaX < 0)
                {
                    charaDelta.m_deltaX = Mathf.Max(0, charaDelta.m_deltaX + brakeDelta);
                }

                if (charaDelta.m_deltaZ > 0)
                {
                    charaDelta.m_deltaZ = Mathf.Min(0, charaDelta.m_deltaZ - brakeDelta);
                }
                else if (charaDelta.m_deltaX < 0)
                {
                    charaDelta.m_deltaZ = Mathf.Max(0, charaDelta.m_deltaZ + brakeDelta);
                }
            }
Ejemplo n.º 5
0
 void ClearDelta(ref CharaDelta charaPos)
 {
     charaPos.m_deltaX = 0;
     charaPos.m_deltaZ = 0;
 }
 void LandState(ref CharaDelta charaDelta)
 {
     charaDelta.m_deltaX = 0;
     charaDelta.m_deltaY = 0;
     charaDelta.m_deltaZ = 0;
 }
 void JumpState(ref CharaDelta charaDelta)
 {
     charaDelta.m_deltaY = JumpSpeed;
 }