Giter Site home page Giter Site logo

apkd / medicine Goto Github PK

View Code? Open in Web Editor NEW
84.0 7.0 6.0 244 KB

Code-driven component injection toolkit for Unity.

License: Creative Commons Attribution 4.0 International

C# 100.00%
unity unity3d unity3d-framework dependency-injection prototyping-tool hacktoberfest

medicine's People

Contributors

apkd avatar bulleador avatar rivfox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

medicine's Issues

False auto-implemented property warning on certain classes

I was using Medicine's Inject.Single on abstract MonoBehaviours today, and it warned me about it not being an auto-implemented property. I did compare that line with other Inject.Single properties elsewhere in the project but I wasn't able to tell the difference. Maybe there's something wrong with using it in abstract classes (?)

Code:

ItemBehaviour.cs:

public abstract class ItemBehaviour<TReference> : MonoBehaviour where TReference : Item
{
	[Inject.Single] // <<  warning Property RenderManager RenderManager needs to be an auto-implemented property to use injection. For example: (No example given)
	protected RenderManager RenderManager { get; }
}

RenderManager.cs:

[Register.Single]
public class RenderManager : MonoBehaviour

Thank you!

Work at editor time?

I find myself wanting injection to happen to some extent during edit mode, for setting things up correctly in OnValidate(), or just for use in editor scripts.

[Inject] public BoxCollider Box { get; }

void OnValidate()
{
	Box.isTrigger = true;
}

I do understand why this doesn't currently work, and I can't think of any super elegant solution off the top of my head.
I thought I'd mention it as something that'd be desirable on the off-chance there's a great way to support this that doesn't create loads of edge cases.

Does not seem to work

Am I missing something? It doesn't seem to work...

image

Failed to initialize CanvasGroup _canvasGroup in component HommeTonnerre.Scripts.Game.UI.Dialogue.DialogPanel.

image

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.