- Home /
This question was
closed Apr 07, 2013 at 07:42 AM by
Fattie for the following reason:
The question is answered, right answer was accepted
Question by
RN · Apr 07, 2013 at 03:33 AM ·
errorcompiler errorcompiler-error
How do I fix compliance error?
Copy and paste correct script please It is a little faster. Thanks
Error is:
Assets/Editor/CopyMoodBox.cs(9,12): error CS0246: The type or namespace name `MoodBoxData' could not be found. Are you missing a using directive or an assembly reference?
Script is:
using UnityEditor; using UnityEngine;
class CopyMoodBox : ScriptableWizard {
static MoodBoxData data;
[MenuItem ("Tools/CopyMoodBox")]
static void Copy () {
if (!Selection.activeGameObject)
return;
data = ((MoodBox)Selection.activeGameObject.GetComponent<MoodBox>()).data;
}
[MenuItem ("Tools/PasteMoodBox")]
static void Paste () {
if (0==Selection.gameObjects.Length)
return;
MoodBoxData copyHere;
int i = 0;
foreach (GameObject obj in Selection.gameObjects) {
if (obj.GetComponent<MoodBox>()) {
copyHere = ((MoodBox)obj.GetComponent()).data;
copyHere.noiseAmount = data.noiseAmount;
copyHere.colorMixBlend = data.colorMixBlend;
copyHere.colorMix = data.colorMix;
copyHere.fogY = data.fogY;
copyHere.fogColor = data.fogColor;
i++;
}
}
Debug.Log ("Mood Box pasted " + i + " times.");
}
}
Comment
Best Answer
Answer by EliteMossy · Apr 07, 2013 at 04:04 AM
You are missing the MoodBoxData script.
And don't demand a script.
Follow this Question
Related Questions
Example Projects do not Compile in Unity 3.0 2 Answers
Internal compiler error 0 Answers
Error Code CS0118 or CS0120 1 Answer