Giter VIP home page Giter VIP logo

myavatarsys's Introduction

MyAvatarSys

English | δΈ­ζ–‡

Author: Shepherd Zhu

Based on UnityDemo_Avatar.

Description

MyAvatarSys is a runtime costume change database that is divided by gender. It also support Addressables.

AvatarRes Class

AvatarRes is a class that stores the runtime costume database according to gender.

Properties

  • mHairList: A list of hair resources.
  • mTopList: A list of top resources.
  • mBtmList: A list of bottom resources.
  • mShoesList: A list of shoe resources.
  • mFaceList: A list of face resources.
  • mEyeList: A list of eye resources.
  • mHairIdx: The index of the current hair resource.
  • mBtmIdx: The index of the current bottom resource.
  • mShoesIdx: The index of the current shoe resource.
  • mTopIdx: The index of the current top resource.
  • mFaceIdx: The index of the current face resource.
  • mEyeIdx: The index of the current eye resource.

Methods

  • Reset(): Resets the costume indexes to the initial state.
  • ReleaseCurrentClothes(): Releases the current clothes assets.
  • AddIndex(int type): Increments the index of the specified costume type.
  • ReduceIndex(int type): Decrements the index of the specified costume type.

MyAvatarSys Class

MyAvatarSys is a class that manages the AvatarRes objects and initializes them.

Properties

  • MaleAvatarRes: The AvatarRes object for male avatars.
  • FemaleAvatarRes: The AvatarRes object for female avatars.

Methods

  • CreateAvatarRes(): Initializes the AvatarRes objects by loading resource locations from Addressables.

MyAvatarCharacter Class

MyAvatarCharacter is a class that applies the AvatarRes to the specific character model.

Properties

  • Hair: The hair game object.
  • Btm: The bottom game object.
  • Shoes: The shoe game object.
  • Top: The top game object.
  • Face: The face game object.
  • Eye: The eye game object.

Methods

  • Generate(AvatarRes avatarres, bool combine): Generates the character model with the specified AvatarRes and combine option.
  • ChangeEquipUnCombine(int type, AvatarRes avatarres): Changes the equipment of the character model without combining meshes.
  • ChangeEquipUnCombine(ref GameObject go, GameObject resgo): Changes the equipment of the character model without combining meshes for a specific game object.
  • ShareSkeletonInstanceWith(SkinnedMeshRenderer selfSkin, GameObject target): Shares the skeleton instance with the target game object.
  • FindChildRecursion(Transform t, string name): Recursively finds a child transform with the specified name.

MyAvatarAssetLoader Class

MyAvatarAssetLoader is a class that finely manages the Addressables handles used by the costume change system.

Methods

  • LoadAssetAsync(string primaryKey, System.Action<GameObject> onComplete): Loads the asset with the specified primary key asynchronously.
  • ReleaseAsset(string primaryKey): Releases the asset with the specified primary key.
  • ReleaseAllAssets(): Releases all loaded assets.

MyAvatarUI Class

MyAvatarUI is a class used for testing costume changes during development.

Properties

  • mAvatarSys: The MyAvatarSys object.
  • mAvatarRes: The current AvatarRes object.
  • mMaleCharacter: The male MyAvatarCharacter object.
  • mFemaleCharacter: The female MyAvatarCharacter object.
  • mCharacter: The current MyAvatarCharacter object.
  • mCombine: The flag for combining meshes.

Methods

  • AddCategory(int parttype, string displayName): Adds a category for changing character elements.

myavatarsys's People

Contributors

shepherd0619 avatar

Stargazers

 avatar  avatar Marcus L Endicott avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.