![]() It all depends on what you mean exactly.Ĭhange the color palette of the environment? You could calculate it in a script and apply it to the color of a given shader. ![]() Where are these colors coming from and where are you combining them? You could add a bunch of colors to a single shader and then let the shader do the work. What do you mean by "combine"? Add? Multiply? Signed Addition? Divide? Subtract? Alpha Blend? What exactly does this mean? You want to change a bunch of different colors and then take the new values and then "combine" them? This seems like a third separate question. If your conversion is simple enough, you really only need to store 2 values and then you can just use Color.Lerp to transition between them. It's easier however to simply store your colors/values in variables or a texture of some sort rather than calculate them at run-time. To change the color values by hue and saturation at run-time, you would need to get the colors, do an HSV conversion or the like and then set the colors to your changed colors. Alternatively, you can use GetColor and SetColor. In certain setups, if you are moving your Transforms by fixed amounts, you may not even need to use such expensive calculations as within some game mechanics, you know how many "spaces" one object is from another and you know the size of a "space".ĭepending on your shader, there is likely a main color, accessible through. If you need to calculate it on the fly and don't have references to your objects, you might use Physics.Raycast. If you store references to the object Transforms, then you can just go (object1-object2).sqrMagnitude for distance squared or (object1-object2).magnitude or Vector3.Distance(object1-object2) for distance. How you do this depends entirely on what you mean by mathematical calculations and the setup which you fail to describe. This should be in a separate question as it is a separate problem. Mathematical calculations on the proximity of objects? Perhaps you should consider breaking the question into separate parts as per the directions in the FAQ. I will try to answer, but without something more specific to go on, I cannot really go into many specifics.Īlso, it's almost like you are asking three or four questions at once. Your question is really general and not described in very explicit or meaningful wording/terminology.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |