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 Oliver 5 · Mar 13, 2011 at 11:27 AM · errorsyntax-errorbce0018

The name 'Decal' does not denote a valid type ('not found')

I have gotten this error:

The name 'Decal' does not denote a valid type ('not found')

pragma strict

pragma implicit

pragma downcast

enum HitType { CONCRETE, WOOD, METAL, OLD_METAL, GLASS, GENERIC }

class BulletMarks extends MonoBehaviour { public var concrete : Texture2D[]; public var wood : Texture2D[]; public var metal : Texture2D[]; public var oldMetal : Texture2D[]; public var glass : Texture2D[]; public var generic : Texture2D[];

public function GenerateDecal(type : HitType, go : GameObject) { var useTexture : Texture2D; var random : int;

 switch(type)
 {
     case HitType.CONCRETE:
         if(concrete == null) return;
         if(concrete.Length == 0) return;

         random = Random.Range(0, concrete.Length);

         useTexture = concrete[random];
         break;
     case HitType.WOOD:
         if(wood == null) return;
         if(wood.Length == 0) return;

         random = Random.Range(0, wood.Length);

         useTexture = wood[random];
         break;
     case HitType.METAL:
         if(metal == null) return;
         if(metal.Length == 0) return;

         random = Random.Range(0, metal.Length);

         useTexture = metal[random];
         break;
     case HitType.OLD_METAL:
         if(oldMetal == null) return;
         if(oldMetal.Length == 0) return;

         random = Random.Range(0, oldMetal.Length);

         useTexture = oldMetal[random];
         break;
     case HitType.GLASS:
         if(glass == null) return;
         if(glass.Length == 0) return;

         random = Random.Range(0, glass.Length);

         useTexture = glass[random];
         break;
     case HitType.GENERIC:
         if(generic == null) return;
         if(generic.Length == 0) return;

         random = Random.Range(0, generic.Length);

         useTexture = generic[random];
         break;
     default:
         if(wood == null) return;
         if(wood.Length == 0) return;

         random = Random.Range(0, wood.Length);

         useTexture = wood[random];
         return;
 }

 transform.Rotate(new Vector3(0, 0, Random.Range(-180.0, 180.0)));

 Decal.dCount++;
 var d : Decal = gameObject.GetComponent("Decal");
 d.affectedObjects = new GameObject[1];
 d.affectedObjects[0] = go;
 d.decalMode = DecalMode.MESH_COLLIDER;
 d.pushDistance = 0.009 + BulletMarkManager.Add(gameObject);
 var m : Material = new Material(d.decalMaterial);
 m.mainTexture = useTexture;
 d.decalMaterial = m;
 d.CalculateDecal();
 d.transform.parent = go.transform;

}

} Blockquote

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

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by loihb · Nov 12, 2011 at 02:37 PM

I find problem why it doesn't work it's working only if decal scripts in Standard Assets folder. (assets/Standard Assets)

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

Answer by zmar0519 · Mar 13, 2011 at 12:25 PM

If you are working from the boot camp demo(which I assume you are), then make sure that there is the editor folder for the decal editor, or else this script will not work!!! :)

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

Answer by monty · Apr 20, 2011 at 03:18 PM

i am having the exact same problem and i have the editor folder with decaleditor.cs in it but nothing has happened. does it need to be in a certain place or is there anything else that needs to be done to make it work

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

1 Person is following this question.

avatar image

Related Questions

I can rotate but not move or I can move but not rotate, console messages. 0 Answers

Editing the jumppad from the 3rd person tutorial 2 Answers

Give help to fix this error 3 Answers

How "include" the Raycast?! 1 Answer

Error "There is already a local variable with the name 'obstacle'." How can I make it work? 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