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 ayadader · Dec 11, 2015 at 01:53 PM · controller

Why give me an error on namespace mset{ public enum Corner {

link textusing UnityEngine; using System.Collections;

namespace mset{ public enum Corner { TopLeft, TopRight, BottomLeft, BottomRight }

 public class logo : MonoBehaviour {
     public Texture2D logoTexture = null;
     public Color color = Color.white;
     public Vector2 logoPixelOffset = new Vector2(0,0);
     public Vector2 logoPercentOffset = new Vector2(0,0);
     public Corner placement = Corner.BottomLeft;
     private Rect texRect = new Rect(0,0,0,0);
     
     void Reset() {
         logoTexture = Resources.Load("renderedLogo") as Texture2D;
     }
     
     void Start() {
     }
 
     void updateTexRect() {
         if( logoTexture ) {
             float tw = logoTexture.width;
             float th = logoTexture.height;
             float cw = 0f;
             float ch = 0f;
             if( this.GetComponent<Camera>() ) {
                 //check attached camera first
                 cw = GetComponent<Camera>().pixelWidth;
                 ch = GetComponent<Camera>().pixelHeight;
             } else if( Camera.main ) {
                 //use first camera tagged as MainCamera
                 cw = Camera.main.pixelWidth;
                 ch = Camera.main.pixelHeight;
             } else if( Camera.current ) {
                 //use currently active camera (mostly harmless)
                 //cw = Camera.current.pixelWidth;
                 //ch = Camera.current.pixelHeight;
             }
             float ox = logoPixelOffset.x + logoPercentOffset.x*cw*0.01f;
             float oy = logoPixelOffset.y + logoPercentOffset.y*ch*0.01f;
             
             switch(placement) {
             case Corner.TopLeft:
                 texRect.x = ox;
                 texRect.y = oy;
                 break;
             case Corner.TopRight:
                 texRect.x = cw - ox - tw;
                 texRect.y = oy;
                 break;
             case Corner.BottomLeft:
                 texRect.x = ox;
                 texRect.y = ch - oy - th;
                 break;
             case Corner.BottomRight:
                 texRect.x = cw - ox - tw;
                 texRect.y = ch - oy - th;
                 break;
             };
             texRect.width = tw;
             texRect.height = th;
         }
     }
     
     void OnGUI() {
         updateTexRect();
         if( logoTexture ) {
             GUI.color = color;
             GUI.DrawTexture(texRect, logoTexture);
         }
     }
 }

}

logo.zip (794 B)
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 steakpinball · Dec 11, 2015 at 02:20 PM 0
Share

It would help if you posted the error.

avatar image ayadader steakpinball · Dec 11, 2015 at 08:42 PM 0
Share

Error publication , but in the attached file with the question .... This is the first time used the site ..

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

FPS Walker bunny hops if stop walking while on slopes 2 Answers

Spaceship Script not working? 0 Answers

optimising player controller 1 Answer

I just started using Unity and while doing the tutorials for rolling the ball which is step 2, I wasn't able to move my ball in Monodevelop 0 Answers

How to add a sprint button on a 3D platformer? In C# 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