예제 #1
0
    public void Update_Action(Action_Strategie.Action_Datas data)
    {
        GameObject new_action = Instantiate(Action_Line_Prefab, Action_Viewer.transform) as GameObject;

        Action_Line updated_line = new_action.GetComponent <Action_Line>();

        updated_line.Update_Action(data);
    }
예제 #2
0
    public void Update_Action(Action_Strategie.Action_Datas data)
    {
        if (Action_Data == null)
        {
            Action_Data       = new Action_Strategie();
            Action_Data.Datas = new Action_Strategie.Action_Datas();
        }

        Action_Data.Datas = data;

        Text_Action_ID.GetComponent <TextMeshProUGUI>().text = Action_Data.Datas.ID.ToString();

        if (Action_Data.Name == null)
        {
            //N'affiche le nom que pour la création
            string text = new string(data.Name, 0, data.Name_Length);
            Action_Data.Name = text;

            Text_Action_Name.GetComponent <TextMeshProUGUI>().text = Action_Data.Name;
        }

        Action_Line previous_values = Action_Liste.Get_Existing_Line(data.ID, data.Robot_ID);

        if (previous_values != null && data.State != previous_values.Action_Data.Datas.State)
        {
            Text_Action_State.GetComponent <TextMeshProUGUI>().fontStyle = FontStyles.Bold;
            Text_Action_State.GetComponent <TextMeshProUGUI>().color     = Color.red;
        }
        Text_Action_State.GetComponent <TextMeshProUGUI>().text = Action_Data.Datas.State.ToString();


        if (previous_values != null && data.Step != previous_values.Action_Data.Datas.Step)
        {
            Text_Action_Step.GetComponent <TextMeshProUGUI>().fontStyle = FontStyles.Bold;
            Text_Action_Step.GetComponent <TextMeshProUGUI>().color     = Color.red;
        }
        Text_Action_Step.GetComponent <TextMeshProUGUI>().text = Action_Data.Datas.Step.ToString();


        if (previous_values != null && data.Priority != previous_values.Action_Data.Datas.Priority)
        {
            Text_Action_Priority.GetComponent <TextMeshProUGUI>().fontStyle = FontStyles.Bold;
            Text_Action_Priority.GetComponent <TextMeshProUGUI>().color     = Color.red;
        }
        Text_Action_Priority.GetComponent <TextMeshProUGUI>().text = Action_Data.Datas.Priority.ToString();


        if (previous_values != null && data.Points != previous_values.Action_Data.Datas.Points)
        {
            Text_Action_Points.GetComponent <TextMeshProUGUI>().fontStyle = FontStyles.Bold;
            Text_Action_Points.GetComponent <TextMeshProUGUI>().color     = Color.red;
        }
        Text_Action_Points.GetComponent <TextMeshProUGUI>().text = Action_Data.Datas.Points.ToString();


        if (previous_values != null && data.Qui_Fait != previous_values.Action_Data.Datas.Qui_Fait)
        {
            Text_Action_Qui_Fait.GetComponent <TextMeshProUGUI>().fontStyle = FontStyles.Bold;
            Text_Action_Qui_Fait.GetComponent <TextMeshProUGUI>().color     = Color.red;
        }
        Text_Action_Qui_Fait.GetComponent <TextMeshProUGUI>().text = Action_Data.Datas.Qui_Fait.ToString();


        if (previous_values != null && data.Qui_Peut != previous_values.Action_Data.Datas.Qui_Peut)
        {
            Text_Action_Qui_Peut.GetComponent <TextMeshProUGUI>().fontStyle = FontStyles.Bold;
            Text_Action_Qui_Peut.GetComponent <TextMeshProUGUI>().color     = Color.red;
        }
        Text_Action_Qui_Peut.GetComponent <TextMeshProUGUI>().text = Action_Data.Datas.Qui_Peut.ToString();


        if (previous_values != null && data.Temps_mini != previous_values.Action_Data.Datas.Temps_mini)
        {
            Text_Action_Temps_mini.GetComponent <TextMeshProUGUI>().fontStyle = FontStyles.Bold;
            Text_Action_Temps_mini.GetComponent <TextMeshProUGUI>().color     = Color.red;
        }
        Text_Action_Temps_mini.GetComponent <TextMeshProUGUI>().text = ((int)(Action_Data.Datas.Temps_mini) * 10).ToString();


        if (previous_values != null && data.Temps_maxi != previous_values.Action_Data.Datas.Temps_maxi)
        {
            Text_Action_Temps_maxi.GetComponent <TextMeshProUGUI>().fontStyle = FontStyles.Bold;
            Text_Action_Temps_maxi.GetComponent <TextMeshProUGUI>().color     = Color.red;
        }
        Text_Action_Temps_maxi.GetComponent <TextMeshProUGUI>().text = ((int)(Action_Data.Datas.Temps_maxi) * 10).ToString();
    }