Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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 Dec 19, 2015 at 05:40 PM by zastrow for the following reason:

Question is off-topic or not relevant

avatar image
0
Question by zastrow · Jul 13, 2015 at 07:46 PM · c#iphonelight

Turn on LED Light on iPhone using C#

I attached this method to a button to see if I could turn on the light on an iPhone;

     public void LightSwitch()
     {
             GetComponent<Light>().enabled = true;
     }

But it doesn't work. Any ideas?

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

2 Replies

  • Sort: 
avatar image
1
Best Answer

Answer by tanoshimi · Jul 13, 2015 at 08:27 PM

"Components" in Unity are scripts written in code that determine how (virtual) objects behave in your game world behave. They have nothing to do with the components on your phone.

"Lights" in Unity are one type of component - the (virtual) lights that determine how your (virtual) scene is rendered. They have nothing to do with any (real) bulbs that may light up on your phone. http://docs.unity3d.com/Manual/Lighting.html

However, it is possible to write a component that accesses the (real) light on your phone. You'll have to write an Obj-C plugin and then interface to that from a C# component. Or, you could investigate a pre-written asset such as this: https://www.assetstore.unity3d.com/en/#!/content/4704

Comment
Add comment · Show 2 · 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 zastrow · Jul 13, 2015 at 08:33 PM 0
Share

Thanks. That explains why I wasn't getting any error messages.

avatar image zastrow · Jul 13, 2015 at 09:27 PM 0
Share

That Torch Plug-in in Unity5 generates build errors: [ARC Restrictions]

avatar image
0

Answer by zastrow · Jul 13, 2015 at 10:22 PM

To solve build errors: [ARC Restrictions] //Add Flag -fno-objc-arc in Xcode / Build Phases / Compile Sources / iOSTorch.mm

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

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

How to prevent world interaction when using UI elements? 1 Answer

How can I find intersection points between a circle and Colliders 2D ? 0 Answers

Rotate a camera when my flashlight is on the edge of the screen... Video included 2 Answers


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