Ejemplo n.º 1
0
    static public void GenerateSelections(List <byte> byteList, SelectionsNode.SelectUnit[] units, string title)
    {
        if (ISelectionsCtrl.Instance == null)
        {
            ISelectionsCtrl selObj = GameObject.FindObjectOfType(typeof(ISelectionsCtrl)) as ISelectionsCtrl;
            if (selObj == null)
            {
                Debug.LogError("ISelectionsCtrl Not Exists.");
                return;
            }
        }
        if (!SelectionsNode.IsTargetSet(units))
        {
            return;
        }

        ByteCodeScriptTools.AddMessagingCode(byteList, "Dialog", OpcodeMessaging.SELECTIONS);
        ByteCodeScriptTools.AddTextLiteralCode(byteList, title);
        byteList.Add(Opcode.SELECTIONS);
        for (int i = 0; i < units.Length; i++)
        {
            if (units[i].targetNode != null)
            {
                SelectionsNode.SelectUnit unit = units[i];

                string targetFunc = units[i].targetNode.GetNodeLabel();                  //Tag(  unit.targetNode.name );
                CodeGenerator.GenerateASelection(byteList, i, targetFunc, unit.text, unit.checkFlag, unit.flagName);
            }
        }
        byteList.Add(Opcode.STOP);
    }
Ejemplo n.º 2
0
//	static private int k_TextDispNum = 25;

    static public void OnGUISelectionUnit(SelectionsNode.SelectUnit unit)
    {
        EditorGUILayout.BeginHorizontal();

        EditorGUILayout.LabelField("target");
        unit.targetNode = EditorGUILayout.ObjectField(unit.targetNode, typeof(ViNode), true) as ViNode;

        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();

        EditorGUILayout.LabelField("Text");
        unit.text = EditorGUILayout.TextField(unit.text);

        EditorGUILayout.EndHorizontal();
    }