Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by thecrapture · Mar 23, 2016 at 01:27 AM · member

already defined member with same parameter types. Line 67 What am I doing wrong

using UnityEngine; using UnityEngine.UI; using System.Collections;

public class TextController : MonoBehaviour {

 public Text text;
 private enum States {cell, mirror, lock_0, sheets_0, cell_mirror, sheets_1, lock_1, freedom};
 private States myState;

 // Use this for initialization
 void Start () {
     myState = States.cell;
 }
 
 // Update is called once per frame
 void Update()
 {
     print(myState);
     if (myState == States.cell)
     {
         state_cell();
     }
     else if (myState == States.sheets_0)
     {
         state_sheets_0();
     }
     else if (myState == States.lock_0)
     {
         state_lock_0();
     }
     else if (myState == States.mirror)
     {
     }     state_mirror();
 }
 void state_cell () {
     text.text = "You are in a prison cell, and you want to escape. There are " +
                     "some dirty sheets on the bed, a mirror on the wall and the door " +
                     "is locked from the outside.\n\n" +
                     "Press S to View sheets, M to view the Mirror, or L to view the lock" ;
     if (Input.GetKeyDown(KeyCode.S)) {
         myState = States.sheets_0;
     }
     if (Input.GetKeyDown(KeyCode.L)){
         myState = States.lock_0;
     }    
 }

 void state_sheets_0 (){
     text.text = "You can't believe you sleep in these things. Surley it's " +
                 "time somebody changed them. The pleasures of prison life " +
                 "I guess!\n\n" +
                 "Press R to Return to roaming your cell";
     if (Input.GetKeyDown(KeyCode.R))
     {
         myState = States.cell;
     }
 }
 void state_lock_0()
 {
     text.text = "It's locked from the outside, doesn't look like there's anyway to pick it " +
                 "If I could get my hands on a key that would help \n\n" +
                 "Press R to Return to roaming your cell";
     if (Input.GetKeyDown(KeyCode.R))
     {
         myState = States.cell;
     }
 }
 void state_mirror()
 {
     text.text = "Just a dirty old mirror, looks like you could take it off the wall though\n\n " +
                 "Press T to take the mirror, press R to return to the cell.";
     if (Input.GetKeyDown(KeyCode.R))
     if (Input.GetKeyDown(KeyCode.T))
     {
         myState = States.cell;
     }
 }

}

Comment
Add comment · Show 1
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 MewEight · Mar 23, 2016 at 02:45 AM 0
Share

I copied your code and it compiled fine. And you might want to check your

      else if (myState == States.mirror)
      {
      }     state_mirror();

0 Replies

· Add your reply
  • Sort: 

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

51 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

An object reference is required to access non-static member 1 Answer

non-static member error 1 Answer

object reference is required to access non-static member - What does this mean? 1 Answer

Unexpected symbol `void' in class, struct, or interface member declaration 1 Answer

C# - Error " does not implement interface member" 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