Esempio n. 1
0
 //	remove them from me and all my descendants.
 public void RemoveITweenComponentsTree()
 {
     RemoveITweenComponents();
     foreach (Transform child in this.transform)
     {
         PositionToggler pt = child.GetComponent <PositionToggler>();
         if (pt != null)
         {
             pt.RemoveITweenComponentsTree();
         }
     }
 }
Esempio n. 2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        PositionToggler myScript = (PositionToggler)target;

        if (GUILayout.Button("Set Keyframe"))
        {
            myScript.SetKeyframe();
        }

        if (GUILayout.Button("Align xpos"))
        {
            myScript.AlignXpos();
        }

        if (GUILayout.Button("Test Toggle"))
        {
            myScript.ToggleNext();
        }

#if QUICKHACK_EDITS
        //	iTween bug keeps creating iTween components in editor
        if (GUILayout.Button("Remove itween components"))
        {
            myScript.RemoveITweenComponentsTree();
        }
        //	hack: do this automatically
        myScript.RemoveITweenComponents();
#endif
#if false       //	one time edit hack
        if (GUILayout.Button("Swap BarSlot PositionToggler 0 and 1"))
        {
            myScript.SwapBarSlotPositions();
        }
#endif
    }