- Home /
The key of animation will add, although the addition is not operated.
Because I used a class from Editor class and wanted to reduce a decimal point,
I made the following sources.
cmnGUIPixelEditor.js
class cmnGUIPixelEditor extends Editor
{
function OnInspectorGUI () {
var myTarget : cmnGUIPixel = target as cmnGUIPixel;
myTarget.m_Pixel = EditorGUILayout.Vector2Field ("Pixel : ", myTarget.m_Pixel);
myTarget.m_Pixel.x = Mathf.Round(myTarget.m_Pixel.x);
myTarget.m_Pixel.y = Mathf.Round(myTarget.m_Pixel.y);
if (GUI.changed){
EditorUtility.SetDirty (myTarget);
}
}
}
cmnGUIPixel.js
var m_Pixel : Vector2 = Vector2.zero;
I added two keys to m_Pixel to let you make animation. (In Animation in Window)
And a key of m_Pixel adds it without permission in "time" of the current mouse cursor position though I do not add a key when I move "time bar" with a mouse for confirmation.
The key is not added when I delete the following processing even if I move a thyme bar and comes back normally.
myTarget.m_Pixel.x = Mathf.Round(myTarget.m_Pixel.x);
myTarget.m_Pixel.y = Mathf.Round(myTarget.m_Pixel.y);
How should I evade it?
Usually, it is not added even if it moves a time bar.
Any help would be appreciated, Thanks!
Comment
Your answer