|
i added two "ColorCorrectionCurves" effect on camera; how turn on/off each one separately in j Script ?! i tried GameObject.GetComponent("ColorCorrectionCurves").enabled; but it can turn on/off just on off the ColorCorrection effect added, but i want to control each on separately; i also tried to create a same copy of ColorCorrectionCurves.js with ColorCorrectionCurves1.js with change name in ColorCorrectionCurvesEditor1.js and even i changed variable name in both script! but the new ColorCorrectionCurves1.js when added, just turned black the screen; most bug report is this : * * i hope and rather a clear and cool solution :)) without changing script and variables names; but if there is not, also please help me. specially thanks to every reader
(comments are locked)
|
|
Normally you would either name them differently, or use Tags (different ones) and find by tag. If they have different parents (or other ancestors), you could find the ancestors by name with a path as described here: http://docs.unity3d.com/Documentation/ScriptReference/GameObject.Find.html Thank you very much dave; but two components are added to a single camera, how i use tag? Clearer,for better color correction, i used this component two times on a camera,do you think i can use tag and GameObject.Find for turn on/off each on of them separately? Mistakenly some where in question i called "glow" component, but "ColorCorrectionCurves" be correct,
Aug 01 '12 at 12:59 AM
HanEisa
No, not in that case. Normally you should not have to add the same component twice to one object. Are there no settings for which a single one of those components works? In any case, here's a clue: http://answers.unity3d.com/questions/162678/how-to-distinguish-between-multiple-components-of.html Basically, set a variable on each component differently, then GetComponents (gets array of them) and look for the one with the variable value you need.
Aug 01 '12 at 01:09 AM
DaveA
Thank you for taking your time to answer me; your guide is true and helpful,also i tried change script and variable name in ColorCorrectionCurves again step-by-step, and it was done,thanks for your assist dear Dave
Aug 01 '12 at 11:18 AM
HanEisa
(comments are locked)
|
