Skip to content
Permalink
c26fa685a4
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
40 lines (30 sloc) 983 Bytes
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<MoodBox>()).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.");
}
}