KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm programming in Unity 3.4.2 on OS X using C#. I have a class like the following: class Foo<T> { public T DoFoo(T bar) { float aFloatValue = 1.0f; // Do other stuff... return aFloatValue * bar; } } When Unity compiles this class, it gives me this error message: error CS0019: Operator *' cannot be applied to operands of type float' and `T' I know that the types I provide for T will support multiplication with float. How can I implement generic multiplication in this case?
Tags (comma-separated)
Save Edits
Cancel