• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by Dan T · May 24, 2010 at 10:40 AM · cameracomponentlayerdocumentationflare

How can I add flare layer via code?

I've looked throught the documentation and can't seem to find any reference to the 'FlareLayer' component other than this

I need to add a flare layer to a scripted camera but I can't find any reference to the component name, constructor or properties in either VS or the documentation. Where is it?

Idealy i need something like: myScriptedCamera.addComponent();

Thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
5
Best Answer

Answer by Mike 3 · May 24, 2010 at 04:47 PM

myScriptedCamera.AddComponent("FlareLayer");

I believe this already got answered in IRC, but thought it would be best to add it here too for completion

FlareLayer only exists in the C++ part of the engine, there is no C# class for it in the API, so you need to use the string version to add it

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Stucko_Stuck · Sep 06, 2012 at 09:48 AM 0
Share

Then how would you disable/enable the flarelayer?

this.gameObject.GetComponent("FlareLayer").enabled=false;

and I got this :

error CS1061: Type `UnityEngine.Component' does not contain a definition for `enabled' and no extension method `enabled' of type `UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

Getting camera to show objects in a layer without the lightings 0 Answers

Use custom URL link for documentation / manual 1 Answer

RTFM afterview 1 Answer

Multi-layer character rendering 1 Answer

Camera Culling Mask not working as expected? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges