public void OnClickButtonModuleSetting()
    {
        if (!buttonDirector)
        {
            buttonDirector = gameObject.GetComponent <ButtonDirector> ();
        }

        // Check if it is in mode
        if (buttonDirector.mode.status)
        {
            // Check if any module is selected
            if (buttonDirector.menuTopDirector.uI2MaComDirector.ma2UIComManager
                .ma2MaComManager.selectionManager.selectedModule != null)
            {
                panelModuleSettingDirector.ShowPanelOrNot(true);
                buttonDirector.menuTopDirector.uI2MaComDirector.statusBarDirector.ResetTextMessage();
            }
            else
            {
                buttonDirector.menuTopDirector.uI2MaComDirector.statusBarDirector.SetTempTextMessage("Please select a module ...");
            }
        }
        else
        {
            buttonDirector.menuTopDirector.uI2MaComDirector.statusBarDirector.ResetTextMessage();
            panelModuleSettingDirector.ShowPanelOrNot(false);
        }
    }
    public void OnClickPlay()
    {
        if (!buttonDirector)
        {
            buttonDirector = gameObject.GetComponent <ButtonDirector> ();
        }

        // Check if it is in mode
        if (buttonDirector.mode.status)
        {
            uI2MaComDirector.ma2UIComManager.ma2MaComManager.robotManager.TakeSnapshot();

            uI2MaComDirector.ma2UIComManager.ma2MaComManager.modulesManager.SetAllModuleMode(ModuleModeController.ModuleMode.Simulation);
            uI2MaComDirector.ma2UIComManager.ma2MaComManager.ma2UIComManager.uI2MaComDirector.panelFileSelectionDirector.ShowPanelOrNot(true);
            panelBehaviorDirector.ShowPanelOrNot(true);
            behaviorManager.robotStateObjectIndex = 0;
            behaviorManager.play = true;
        }
        else
        {
            behaviorManager.play = false;
            if (behaviorManager.currentCoroutine != null)
            {
                StopCoroutine(behaviorManager.currentCoroutine);
            }
            panelBehaviorDirector.ShowPanelOrNot(false);
            uI2MaComDirector.ma2UIComManager.ma2MaComManager.ma2UIComManager.uI2MaComDirector.panelFileSelectionDirector.ShowPanelOrNot(false);
            uI2MaComDirector.ma2UIComManager.ma2MaComManager.modulesManager.SetAllModuleMode(ModuleModeController.ModuleMode.Edit);
            uI2MaComDirector.ma2UIComManager.ma2MaComManager.robotManager.LiftRobot();
        }
    }
    public void OnClickRecord()
    {
        if (!buttonDirector)
        {
            buttonDirector = gameObject.GetComponent <ButtonDirector> ();
        }

        // Check if it is in mode
        if (buttonDirector.mode.status)
        {
            panelBehaviorDirector.ShowPanelOrNot(true);
        }
        else
        {
            panelBehaviorDirector.ShowPanelOrNot(false);
        }
    }
 // Use this for initialization
 void Start()
 {
     buttonDirector = gameObject.GetComponent <ButtonDirector> ();
 }