Big client character refactor

This commit is contained in:
2024-04-21 15:04:12 -04:00
parent 36625162a1
commit 65e4b7eef2
9 changed files with 152 additions and 110 deletions

View File

@@ -4,6 +4,7 @@
type UDP = UnreliableRemoteEvent
type CurrentCamera = Camera
type CharacterShared = Folder
type ClassConstructor = typeof(setmetatable({} :: Constructor_Return_Props, {} :: Impl_Constructor))
type Impl_Constructor = {
@@ -14,7 +15,7 @@ type Impl_Constructor = {
Disable: (self: ClassConstructor) -> ()
} & Impl_Static_Props
type Constructor_Fun = (CurrentCamera: CurrentCamera) -> ClassConstructor
type Constructor_Fun = (CharacterShared: CharacterShared, CurrentCamera: CurrentCamera) -> ClassConstructor
type Impl_Static_Props = {
Running: boolean
}
@@ -23,6 +24,8 @@ type Constructor_Return_Props = {
CurrentCamera: CurrentCamera
}
export type SpineConstructor = ClassConstructor
local Spine = {} :: Impl_Constructor
Spine.__index = Spine
@@ -30,16 +33,14 @@ Spine.Running = false
local Storage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Delta = require(Storage:WaitForChild("Delta"))
local Player = Players.LocalPlayer
local CharacterShared = _G.include(script, "CharacterShared")
function Spine.constructor(CurrentCamera: CurrentCamera)
function Spine.constructor(CharacterShared, CurrentCamera)
return setmetatable({
Remote = CharacterShared:WaitForChild("SpineStream"),
CurrentCamera = CurrentCamera
Remote = CharacterShared:WaitForChild("SpineStream") :: UDP,
CurrentCamera = CurrentCamera :: CurrentCamera
}, Spine)
end