{"id":20139407,"url":"https://github.com/mackysoft/modiferty","last_synced_at":"2025-07-28T12:39:35.639Z","repository":{"id":111399595,"uuid":"265178664","full_name":"mackysoft/Modiferty","owner":"mackysoft","description":"Property Modification for Unity","archived":false,"fork":false,"pushed_at":"2024-09-03T20:57:24.000Z","size":568,"stargazers_count":24,"open_issues_count":1,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T20:22:32.180Z","etag":null,"topics":["c-sharp","modification","modifier","properties","unirx","unity"],"latest_commit_sha":null,"homepage":"https://mackysoft.github.io/Modiferty/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mackysoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-05-19T07:38:28.000Z","updated_at":"2024-12-29T16:49:45.000Z","dependencies_parsed_at":"2023-05-18T15:01:43.335Z","dependency_job_id":null,"html_url":"https://github.com/mackysoft/Modiferty","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackysoft%2FModiferty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackysoft%2FModiferty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackysoft%2FModiferty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mackysoft%2FModiferty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mackysoft","download_url":"https://codeload.github.com/mackysoft/Modiferty/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085718,"owners_count":21045199,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","modification","modifier","properties","unirx","unity"],"created_at":"2024-11-13T21:45:11.330Z","updated_at":"2025-04-09T18:22:25.947Z","avatar_url":"https://github.com/mackysoft.png","language":"C#","readme":"﻿# Modiferty - Property Modification\n\n**Created by Hiroya Aramaki ([Makihiro](https://twitter.com/makihiro_dev))**\n\n[![Tests](https://github.com/mackysoft/Modiferty/actions/workflows/tests.yaml/badge.svg)](https://github.com/mackysoft/Modiferty/actions/workflows/tests.yaml)\n[![Build](https://github.com/mackysoft/Modiferty/actions/workflows/build.yaml/badge.svg)](https://github.com/mackysoft/Modiferty/actions/workflows/build.yaml)\n[![Release](https://img.shields.io/github/v/release/mackysoft/Modiferty)](https://github.com/mackysoft/Modiferty/releases)\n[![openupm](https://img.shields.io/npm/v/com.mackysoft.modiferty?label=openupm\u0026registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.mackysoft.modiferty/)\n\n## What is Modiferty ?\n\nModiferty is a great solution for making modifications to properties.\n\nIn games, there are often situations in which the status of characters, weapons, etc. temporarily change.\n\nModiferty can be used in the following situations.\n\n- Want to modify the in-game character status temporally.\n\n## \u003ca id=\"index\" href=\"#index\"\u003e Table of Contents \u003c/a\u003e\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Using ModifierList](#using-modifierlist)\n- [Modifier Types](#modifier-types)\n\t- [Set Modifier](#set-modifier)\n\t- [Create Modifier](#create-modifier)\n- [External Assets](#external-assets)\n  - [UniRx](#unirx)\n- [Author Info](#author-info)\n- [License](#license)\n\n# \u003ca id=\"installation\" href=\"#installation\"\u003e Installation \u003c/a\u003e\n\nDownload any version from releases.\n\nReleases: https://github.com/mackysoft/Modiferty/releases\n\n# \u003ca id=\"usage\" href=\"#requirements\"\u003e Usage \u003c/a\u003e\n\nAdd \"MackySoft.Modiferty\" namespace into using area.\n\n```cs\nusing MackySoft.Modiferty;\n```\n\nThe following code implements a temporary increase the character attack power.\n\n```cs\npublic class Character : MonoBehaviour {\n\n\tpublic int health = 3;\n\tpublic ModifiableInt attackPower = new ModifiableInt(baseValue: 1);\n\n\tpublic void Attack (Character target){\n\t\ttarget.health -= attackPower.Evaluate();\n\t}\n\n}\n\npublic class PowerUpItem : MonoBehaviour {\n\n\tpublic AdditiveModifierInt additivePower = new AdditiveModifierInt(1);\n\n\tpublic void Modify (Character target){\n\t\ttarget.attackPower.Modifiers.Add(additivePower);\n\n\t\t// Same as below.\n\t\t// target.attackPower.AddModifier(additivePower);\n\t}\n\n}\n```\n\n## \u003ca id=\"using-modifierlist\" href=\"#using-modifierlist\"\u003e Using ModifierList \u003c/a\u003e\n\nIf you want to modify the value without using ModifiableProperty, use a ModifierList.\n\n```cs\nModifierList\u003cint\u003e m_DamageModifiers = new ModifierList\u003cint\u003e;\n\n// Add something modifiers.\nm_DamageModifiers.Add(modifier);\n\n// Evaluate the damage.\nint evaluatedDamage = m_DamageModifiers.Evaluate(damage);\n```\n\nModifiableList is also used in the ModifiableProperty implementation.\n\n\n# \u003ca id=\"modifier-types\" href=\"#modifier-types\"\u003e Modifier Types \u003c/a\u003e\n\nBasic operator modifiers are provided.\n\n- Additive Modifier\n- Subtractive Modifier\n- Multiply Modifier\n- Division Modifier\n\nA variety of other unique modifiers are also available.\n\n## \u003ca id=\"set-modifier\" href=\"#set-modifier\"\u003e Set Modifier \u003c/a\u003e\n\nThe given value ignored and the specified value returned.\n\n```cs\nvar setModifier = new SetModifierInt(0);\n\ncharacter.attackPower.AddModifier(setModifier);\n\n// result is always 0.\nint result = character.attackPower.Evaluate();\n```\n\n## \u003ca id=\"create-modifier\" href=\"#create-modifier\"\u003e Create Modifier \u003c/a\u003e\n\nThe lambda formula allows you to improvise complex modifiers.\n\n```cs\nvar createModifier = new CreateModifier\u003cint\u003e(value =\u003e {\n\tint result;\n\n\t// Do something process...\n\n\treturn result;\n});\n```\n\n# \u003ca id=\"external-assets\" href=\"#external-assets\"\u003e External Assets \u003c/a\u003e\n\nModiferty supports integration with some external assets.\n\n## \u003ca id=\"unirx\" href=\"#unirx\"\u003e UniRx \u003c/a\u003e\n\nInstall UniRx and define `MODIFERTY_UNIRX` to enable integration with UniRx.\n\nUniRx: [https://github.com/neuecc/UniRx](https://github.com/neuecc/UniRx)\n\nThe integration with UniRx mainly adds the following APIs to allow you to observe the values of Modiferty.\n\n- `ReactiveModifierList\u003cT\u003e`\n- `ReactiveModifiableProperty\u003cT\u003e`\n\n```cs\nusing UnityEngine;\nusing UnityEngine.UI;\nusing MackySoft.Modiferty;\nusing UniRx;\n\npublic class Character : MonoBehaviour {\n\n\t// Define attackPower as ReactiveModifiableProperty.\n\tpublic ReactiveModifiableInt attackPower = new ReactiveModifiableInt(baseValue: 1);\n\n\t. . . . .\n\n}\n\npublic class CharacterAttackPowerUI : MonoBehaviour {\n\n\tpublic Character character;\n\tpublic Text attackPowerTsxt;\n\n\tvoid Awake () {\n\t\t// You can observe changes BaseValue and Modifiers.\n\t\tcharacter.attackPower.ObserveChanged().Subscribe(property =\u003e {\n\n\t\t\t// Apply the attackPower change to the text.\n\t\t\tattackPowerText.text = property.Evaluate();\n\t\t});\n\t}\n}\n```\n\n\n# \u003ca id=\"author-info\" href=\"#author-info\"\u003e Author Info \u003c/a\u003e\n\nHiroya Aramaki is a indie game developer in Japan.\n\n- Blog: [https://mackysoft.net/blog](https://mackysoft.net/blog)\n- Twitter: [https://twitter.com/makihiro_dev](https://twitter.com/makihiro_dev)\n\n# \u003ca id=\"license\" href=\"#license\"\u003e License \u003c/a\u003e\n\nThis library is under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmackysoft%2Fmodiferty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmackysoft%2Fmodiferty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmackysoft%2Fmodiferty/lists"}