C# Class UnityRose.ResourceManager

This singleton class loads common resources into memory for quick access. Avoids having to reload certain resources that are almost always needed. For example ZSC files, every time a piece of armor is equipped or appears on another player. TODO: This class should be improved to cache most common equipment.
Afficher le fichier Open project: osROSE/UnityRose Class Usage Examples

Méthodes publiques

Свойство Type Description
instance ResourceManager
stb_animation_list UnityRose.Formats.STB
stb_animation_type UnityRose.Formats.STB
stb_cap_list UnityRose.Formats.STB
stb_hair_list UnityRose.Formats.STB
stb_weapon_list UnityRose.Formats.STB
weapon_type_lookup WeaponType>.Dictionary
zmd_female UnityRose.Formats.ZMD
zmd_male UnityRose.Formats.ZMD
zsc_arms_female UnityRose.Formats.ZSC
zsc_arms_male UnityRose.Formats.ZSC
zsc_back UnityRose.Formats.ZSC
zsc_body_female UnityRose.Formats.ZSC
zsc_body_male UnityRose.Formats.ZSC
zsc_cap_female UnityRose.Formats.ZSC
zsc_cap_male UnityRose.Formats.ZSC
zsc_faceItem UnityRose.Formats.ZSC
zsc_face_female UnityRose.Formats.ZSC
zsc_face_male UnityRose.Formats.ZSC
zsc_foot_female UnityRose.Formats.ZSC
zsc_foot_male UnityRose.Formats.ZSC
zsc_hair_female UnityRose.Formats.ZSC
zsc_hair_male UnityRose.Formats.ZSC
zsc_subweapon UnityRose.Formats.ZSC
zsc_weapon UnityRose.Formats.ZSC

Méthodes publiques

Méthode Description
GenerateAnimationAsset ( GenderType gender, RigType rig, String>.Dictionary zmoPaths ) : void
GenerateAnimationAsset ( GenderType gender, WeaponType weapon ) : void

Generate an animation prefab for the given gender and weapon

GenerateAnimationAssets ( ) : void

Loop through all weapon types for each gender and create an animation asset and all associated clips The animations and clips are placed in GameData/Animation

GetZMOPath ( WeaponType WeaponType, ActionType Action, GenderType Gender ) : string

Get Animation ZMO File path

LoadAnimations ( GameObject player, ZMD skeleton, WeaponType weapon, GenderType gender ) : void

Loads all animations for equiped weapon type. Used only in editor to generate prefabs

LoadClips ( GameObject skeleton, ZMD zmd, GenderType gender, RigType rig, String>.Dictionary zmoPaths ) : void
LoadClips ( GameObject skeleton, ZMD zmd, WeaponType weapon, GenderType gender ) : void

Loads all animations for given weapon type and gender. The clips are saved to Animation/{gender}/{weapon}/clips/{action}.anim Used only in editor to generate prefabs

cachedLoad ( string path ) : object

Checks the cache to see if the resource has already been loaded recently If found, returns the cached resource from memory (fast) If not found, loads the resource from file (slow) and caches the resource

getWeaponType ( int weaponID ) : WeaponType
getZSC ( GenderType gender, BodyPartType bodyPart ) : ZSC

Get the ZSC object associated with the given gender and bodyPart

loadBindPoses ( GameObject skeleton, GenderType gender, WeaponType weapon ) : BindPoses

Load bindposes and bones matrices from resources scriptable object

loadResource ( string path ) : object

Load a Rose Asset from text asset resource file to memory. Not cached.

loadSkeleton ( GenderType gender, RigType rig ) : GameObject
loadSkeleton ( GenderType gender, WeaponType weapon ) : GameObject

Load a skeleton game object from resources prefab

unloadResource ( UnityEngine resource ) : void

Private Methods

Méthode Description
ResourceManager ( ) : UnityEditor
getBoneNames ( Transform transforms ) : string[]

Method Details

GenerateAnimationAsset() public méthode

public GenerateAnimationAsset ( GenderType gender, RigType rig, String>.Dictionary zmoPaths ) : void
gender GenderType
rig RigType
zmoPaths String>.Dictionary
Résultat void

GenerateAnimationAsset() public méthode

Generate an animation prefab for the given gender and weapon
public GenerateAnimationAsset ( GenderType gender, WeaponType weapon ) : void
gender GenderType
weapon WeaponType
Résultat void

GenerateAnimationAssets() public méthode

Loop through all weapon types for each gender and create an animation asset and all associated clips The animations and clips are placed in GameData/Animation
public GenerateAnimationAssets ( ) : void
Résultat void

GetZMOPath() public méthode

Get Animation ZMO File path
public GetZMOPath ( WeaponType WeaponType, ActionType Action, GenderType Gender ) : string
WeaponType WeaponType Equiped Weapon
Action ActionType
Gender GenderType Player Gender
Résultat string

LoadAnimations() public méthode

Loads all animations for equiped weapon type. Used only in editor to generate prefabs
public LoadAnimations ( GameObject player, ZMD skeleton, WeaponType weapon, GenderType gender ) : void
player UnityEngine.GameObject
skeleton UnityRose.Formats.ZMD
weapon WeaponType
gender GenderType
Résultat void

LoadClips() public méthode

public LoadClips ( GameObject skeleton, ZMD zmd, GenderType gender, RigType rig, String>.Dictionary zmoPaths ) : void
skeleton UnityEngine.GameObject
zmd UnityRose.Formats.ZMD
gender GenderType
rig RigType
zmoPaths String>.Dictionary
Résultat void

LoadClips() public méthode

Loads all animations for given weapon type and gender. The clips are saved to Animation/{gender}/{weapon}/clips/{action}.anim Used only in editor to generate prefabs
public LoadClips ( GameObject skeleton, ZMD zmd, WeaponType weapon, GenderType gender ) : void
skeleton UnityEngine.GameObject
zmd UnityRose.Formats.ZMD
weapon WeaponType
gender GenderType
Résultat void

cachedLoad() public méthode

Checks the cache to see if the resource has already been loaded recently If found, returns the cached resource from memory (fast) If not found, loads the resource from file (slow) and caches the resource
public cachedLoad ( string path ) : object
path string
Résultat object

getWeaponType() public méthode

public getWeaponType ( int weaponID ) : WeaponType
weaponID int
Résultat WeaponType

getZSC() public méthode

Get the ZSC object associated with the given gender and bodyPart
public getZSC ( GenderType gender, BodyPartType bodyPart ) : ZSC
gender GenderType
bodyPart BodyPartType
Résultat UnityRose.Formats.ZSC

loadBindPoses() public méthode

Load bindposes and bones matrices from resources scriptable object
public loadBindPoses ( GameObject skeleton, GenderType gender, WeaponType weapon ) : BindPoses
skeleton UnityEngine.GameObject
gender GenderType
weapon WeaponType
Résultat BindPoses

loadResource() public méthode

Load a Rose Asset from text asset resource file to memory. Not cached.
public loadResource ( string path ) : object
path string
Résultat object

loadSkeleton() public méthode

public loadSkeleton ( GenderType gender, RigType rig ) : GameObject
gender GenderType
rig RigType
Résultat UnityEngine.GameObject

loadSkeleton() public méthode

Load a skeleton game object from resources prefab
public loadSkeleton ( GenderType gender, WeaponType weapon ) : GameObject
gender GenderType
weapon WeaponType
Résultat UnityEngine.GameObject

unloadResource() public méthode

public unloadResource ( UnityEngine resource ) : void
resource UnityEngine
Résultat void

Property Details

instance public_oe static_oe property

public static ResourceManager,UnityRose instance
Résultat ResourceManager

stb_animation_list public_oe property

public STB,UnityRose.Formats stb_animation_list
Résultat UnityRose.Formats.STB

stb_animation_type public_oe property

public STB,UnityRose.Formats stb_animation_type
Résultat UnityRose.Formats.STB

stb_cap_list public_oe property

public STB,UnityRose.Formats stb_cap_list
Résultat UnityRose.Formats.STB

stb_hair_list public_oe property

public STB,UnityRose.Formats stb_hair_list
Résultat UnityRose.Formats.STB

stb_weapon_list public_oe property

public STB,UnityRose.Formats stb_weapon_list
Résultat UnityRose.Formats.STB

weapon_type_lookup public_oe static_oe property

public static Dictionary weapon_type_lookup
Résultat WeaponType>.Dictionary

zmd_female public_oe property

public ZMD,UnityRose.Formats zmd_female
Résultat UnityRose.Formats.ZMD

zmd_male public_oe property

public ZMD,UnityRose.Formats zmd_male
Résultat UnityRose.Formats.ZMD

zsc_arms_female public_oe property

public ZSC,UnityRose.Formats zsc_arms_female
Résultat UnityRose.Formats.ZSC

zsc_arms_male public_oe property

public ZSC,UnityRose.Formats zsc_arms_male
Résultat UnityRose.Formats.ZSC

zsc_back public_oe property

public ZSC,UnityRose.Formats zsc_back
Résultat UnityRose.Formats.ZSC

zsc_body_female public_oe property

public ZSC,UnityRose.Formats zsc_body_female
Résultat UnityRose.Formats.ZSC

zsc_body_male public_oe property

public ZSC,UnityRose.Formats zsc_body_male
Résultat UnityRose.Formats.ZSC

zsc_cap_female public_oe property

public ZSC,UnityRose.Formats zsc_cap_female
Résultat UnityRose.Formats.ZSC

zsc_cap_male public_oe property

public ZSC,UnityRose.Formats zsc_cap_male
Résultat UnityRose.Formats.ZSC

zsc_faceItem public_oe property

public ZSC,UnityRose.Formats zsc_faceItem
Résultat UnityRose.Formats.ZSC

zsc_face_female public_oe property

public ZSC,UnityRose.Formats zsc_face_female
Résultat UnityRose.Formats.ZSC

zsc_face_male public_oe property

public ZSC,UnityRose.Formats zsc_face_male
Résultat UnityRose.Formats.ZSC

zsc_foot_female public_oe property

public ZSC,UnityRose.Formats zsc_foot_female
Résultat UnityRose.Formats.ZSC

zsc_foot_male public_oe property

public ZSC,UnityRose.Formats zsc_foot_male
Résultat UnityRose.Formats.ZSC

zsc_hair_female public_oe property

public ZSC,UnityRose.Formats zsc_hair_female
Résultat UnityRose.Formats.ZSC

zsc_hair_male public_oe property

public ZSC,UnityRose.Formats zsc_hair_male
Résultat UnityRose.Formats.ZSC

zsc_subweapon public_oe property

public ZSC,UnityRose.Formats zsc_subweapon
Résultat UnityRose.Formats.ZSC

zsc_weapon public_oe property

public ZSC,UnityRose.Formats zsc_weapon
Résultat UnityRose.Formats.ZSC