Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 /
This question was closed Jun 16, 2014 at 11:50 PM by Tanshaydar for the following reason:

The question is answered, right answer was accepted

avatar image
0
Question by Tanshaydar · Apr 07, 2014 at 01:20 AM · accessing from any scriptssao

Accessing Screen Space Ambient Obscurance on Runtime

Hi, Since SSAObscurance is newer, better and more optimized than SSAOcclusion as indicated here: http://docs.unity3d.com/Documentation/Components/script-AmbientObscurance.html I am using it for my project.

However, I cannot reach this script from other scripts like I can in SSAO. For example,

 Camera.main.GetComponent<SSAOEffect> ().enabled = UIToggle.current.value;

is possible, but I cannot do that with Obscurance.

Is it possible? Thanks.

Comment
Add comment · Show 2
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 Tanshaydar · Apr 10, 2014 at 01:07 AM 0
Share

Come one, does no one know?

avatar image MaT227 · Apr 14, 2014 at 05:32 AM 0
Share

Did the solution below worked ?

1 Reply

  • Sort: 
avatar image
0
Best Answer

Answer by MaT227 · Apr 10, 2014 at 06:36 AM

First, are you sure that when you call Camera.main you get your Camera with AmbientObscurance.

If you want to call you AmbientObscurance from a C# class, you'll need to move the AmbientObscurance script in the Plugins folder like explained here: Unity3D: JavaScript->C# or C#->JavaScript access.

Then you can call it like this.

 AmbientObscurance ao = Camera.main.GetComponent<AmbientObscurance>();
 ao.enabled = false;

The strange thing is that normally if the script is put in the Standard Assets folder it should be compiled before others and then should be accessible but this is not the case...

If you don't want to change the script's place, you can try calling it with a js script.

Comment
Add comment · 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

Follow this Question

Answers Answers and Comments

22 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Screen Space Ambient Occlusion (SSAO) alternative for iOS 0 Answers

Get GameObject From Another Script 1 Answer

Access prefab component without instantiating 1 Answer

Accessing a list from another script 2 Answers

Access different colliders from one one script 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges