Cleaning a bit
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
namespace Marro.PacManUdon
|
||||
{
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDK3.Data;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon;
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDK3.Data;
|
||||
|
||||
namespace Marro.PacManUdon
|
||||
{
|
||||
[RequireComponent(typeof(Animator))]
|
||||
[RequireComponent(typeof(Renderer))]
|
||||
[RequireComponent(typeof(Collider))]
|
||||
public class BonusFruit : UdonSharpBehaviour
|
||||
{
|
||||
[SerializeField, UdonSynced, FieldChangeCallback(nameof(FruitType))] PacManFruitType fruitType;
|
||||
PacManFruitType fruitType;
|
||||
|
||||
Animator animator;
|
||||
new Renderer renderer;
|
||||
@@ -67,7 +68,6 @@
|
||||
this.fruitType = fruitType;
|
||||
value = (int)fruitScoreValue[PacManConstants.FruitTypeToValue(fruitType)];
|
||||
animator.SetFloat("FruitType", PacManConstants.FruitTypeToValue(fruitType));
|
||||
RequestSerialization();
|
||||
}
|
||||
|
||||
public void SetFrozen(bool frozen)
|
||||
@@ -80,7 +80,6 @@
|
||||
renderer.enabled = active;
|
||||
collider.enabled = active;
|
||||
this.active = active;
|
||||
RequestSerialization();
|
||||
}
|
||||
|
||||
public PacManFruitType FruitType
|
||||
@@ -101,18 +100,17 @@
|
||||
get => active;
|
||||
}
|
||||
|
||||
private DataDictionary fruitScoreValue = new DataDictionary()
|
||||
{
|
||||
{(int)PacManFruitType.None , 0},
|
||||
{(int)PacManFruitType.Cherries , 100},
|
||||
{(int)PacManFruitType.Strawberry, 300},
|
||||
{(int)PacManFruitType.Peach , 500},
|
||||
{(int)PacManFruitType.Apple , 700},
|
||||
{(int)PacManFruitType.Grapes , 1000},
|
||||
{(int)PacManFruitType.Galaxian , 2000},
|
||||
{(int)PacManFruitType.Bell , 3000},
|
||||
{(int)PacManFruitType.Key , 5000}
|
||||
};
|
||||
|
||||
private readonly DataDictionary fruitScoreValue = new DataDictionary()
|
||||
{
|
||||
{(int)PacManFruitType.None , 0},
|
||||
{(int)PacManFruitType.Cherries , 100},
|
||||
{(int)PacManFruitType.Strawberry, 300},
|
||||
{(int)PacManFruitType.Peach , 500},
|
||||
{(int)PacManFruitType.Apple , 700},
|
||||
{(int)PacManFruitType.Grapes , 1000},
|
||||
{(int)PacManFruitType.Galaxian , 2000},
|
||||
{(int)PacManFruitType.Bell , 3000},
|
||||
{(int)PacManFruitType.Key , 5000}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -315,10 +315,6 @@ namespace Marro.PacManUdon
|
||||
{
|
||||
// Debug.Log($"{gameObject} State transitioning from {gameState} to {newGameState}");
|
||||
gameState = newGameState;
|
||||
if (Networking.IsOwner(gameObject))
|
||||
{
|
||||
RequestSerialization();
|
||||
}
|
||||
}
|
||||
|
||||
private void IncrementLevel()
|
||||
@@ -348,7 +344,6 @@ namespace Marro.PacManUdon
|
||||
}
|
||||
|
||||
SetScore(this.score + score);
|
||||
RequestSerialization();
|
||||
}
|
||||
|
||||
void SetScore(int score)
|
||||
|
||||
@@ -145,7 +145,6 @@ namespace Marro.PacManUdon
|
||||
|
||||
faceInStartingDirectionUntilUnfrozen = true;
|
||||
UpdateAnimator();
|
||||
RequestSerialization();
|
||||
|
||||
// Debug.Log($"{gameObject} reset with state: {state}, target: {target}, offGrid: {offGrid}");
|
||||
}
|
||||
@@ -666,7 +665,6 @@ namespace Marro.PacManUdon
|
||||
}
|
||||
this.scattering = scattering;
|
||||
UpdateAnimator();
|
||||
RequestSerialization();
|
||||
}
|
||||
|
||||
public void SetFrozen(bool frozen, bool ignoreIfCaught = false, bool keepAnimating = false)
|
||||
|
||||
@@ -92,7 +92,6 @@
|
||||
}
|
||||
|
||||
SetScattering(true, reverseDirection: false);
|
||||
RequestSerialization();
|
||||
}
|
||||
|
||||
public void NewLevel()
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
namespace Marro.PacManUdon
|
||||
{
|
||||
using System;
|
||||
using UdonSharp;
|
||||
using UnityEngine;
|
||||
using VRC.SDKBase;
|
||||
using VRC.Udon;
|
||||
using VRC.SDK3.Components;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using VRC.SDK3.Components;
|
||||
using VRC.SDKBase;
|
||||
|
||||
namespace Marro.PacManUdon
|
||||
{
|
||||
[RequireComponent(typeof(Animator))]
|
||||
[RequireComponent(typeof(Renderer))]
|
||||
public class PacMan : GridMover
|
||||
{
|
||||
private GameManager gameController;
|
||||
@@ -28,12 +28,11 @@
|
||||
private Vector2[] predefinedPath;
|
||||
private int predefinedPathIndex;
|
||||
|
||||
private Vector2 syncedPosition;
|
||||
private Vector2 targetDirection;
|
||||
private float freezeSeconds;
|
||||
private bool frozen;
|
||||
|
||||
#region Animator constants
|
||||
#region Animator constants
|
||||
private const string AnimatorKeyDead = "Dead";
|
||||
private const string AnimatorKeyDirection = "Direction";
|
||||
private const float AnimatorDirectionNone = 0f;
|
||||
@@ -42,7 +41,7 @@
|
||||
private const float AnimatorDirectionUp = 0.75f;
|
||||
private const float AnimatorDirectionDown = 1f;
|
||||
private const float AnimatorDirectionRightBig = 1.25f;
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
public void Initialize(PlayerInput input, VRCObjectPool pelletPool, GameManager gameController)
|
||||
@@ -62,8 +61,7 @@
|
||||
public void Reset()
|
||||
{
|
||||
// Debug.Log($"{gameObject} Reset!");
|
||||
transform.localPosition = startPosition;
|
||||
transform.localRotation = startRotation;
|
||||
transform.SetLocalPositionAndRotation(startPosition, startRotation);
|
||||
transform.localScale = startScale;
|
||||
direction = Vector2.left;
|
||||
targetDirection = Vector2.left;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Marro.PacManUdon
|
||||
bool waitingForTimeSequenceFinalize;
|
||||
bool jumpingToTimeSequence;
|
||||
PacManTimeSequence currentTimeSequence;
|
||||
[UdonSynced] float timeSequenceSecondsPassed;
|
||||
float timeSequenceSecondsPassed;
|
||||
int timeSequenceProgress;
|
||||
float[] timeSequenceKeyframeTimes;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user