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 /
avatar image
0
Question by corriedotdev · Apr 11, 2014 at 11:17 AM · c#gameobjectsetactiveadvertising

c# Set Active error, conflicting with other code..

Hi all, i have ads on my app but im looking into eCPM instead. Im now looking into using revmob and its conflicting with the following code. using UnityEngine; using System.Collections;

 public class Tutorial : MonoBehaviour
 {
     public GameObject Image1;
     public GameObject Image2;
     public GameObject Image3;
     public GameObject Image4;
     public GameObject Image5;
     public GameObject Image6;
 
     public int count = 0;
     public AudioClip sound;
     void Update ()
     {
         foreach (Touch touch in Input.touches)
         {
             if (touch.phase == TouchPhase.Ended)
 
                 if (count == 0){
                     count = count + 1;
                 } else if (count == 1){
                     Image1.SetActive(false);
                     Image2.SetActive(true);
                     audio.PlayOneShot(sound);
                     count = count + 1;
                 } else if (count == 2){
                     Image2.SetActive(false);
                     Image3.SetActive(true);
                     audio.PlayOneShot(sound);
                     count = count + 1;
                 } else if (count == 3){
                     Image3.SetActive(false);
                     Image4.SetActive(true);
                     audio.PlayOneShot(sound);
                     count = count + 1;
                 } else if (count == 4){
                     Image4.SetActive(false);
                     Image5.SetActive(true);
                     audio.PlayOneShot(sound);
                     count = count + 1;
                 } else if (count == 5){
                     Image5.SetActive(false);
                     Image6.SetActive(true);
                     audio.PlayOneShot(sound);
                     count = count + 1;
                 } else if (count == 6){
                     audio.PlayOneShot(sound);
                     Application.LoadLevel ("Menu");
             }
         }
     }
 }


coming up with this error

 Error: Analytics Event: 5(Compiler*error CS1061*Type `GameObject' does not contain a definition for `SetActive' and no extension method `SetActive' of type `GameObject' could be found (are you missing a using directive or an assembly reference?))(1): skipped because it was sent more than once in 0.10 seconds
 Assets/Scripts/Tutorial.cs(45,48): error CS1061: Type `GameObject' does not contain a definition for `SetActive' and no extension method `SetActive' of type `GameObject' could be found (are you missing a using directive or an assembly reference?)

The following code, if removed from the project there will be no errors, but causes the above error if it is in the game.

 using System;
 using System.Collections;
 using System.Collections.Generic;
 
 using UnityEngine;
 
 public class GameObject : MonoBehaviour {
     private static readonly Dictionary<String, String> REVMOB_APP_IDS = new Dictionary<String, String>() {
         { "Android", "5347c63064234ab25e0f4868"},
     };
     private RevMob revmob;
     
     void Awake() {
         revmob = RevMob.Start(REVMOB_APP_IDS, "Ads");
     }
 }

I appreciate the help!

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
0
Best Answer

Answer by corriedotdev · Apr 11, 2014 at 11:21 AM

OK again i have answered my own question. The script was in a different scene. And it turns out i already am using eCPM

Thanks

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

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.

Follow this Question

Answers Answers and Comments

21 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

Related Questions

How do I alter all children of a gameobject at once? 1 Answer

gameObject.setActive(false) is disabling the wrong objects 2 Answers

GameObject.setActive(bool) is not activating my gameObject 1 Answer

Multiple Cars not working 1 Answer

GameObjects that I deactivate are reactivated immediately 0 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