Exemplo n.º 1
0
        private void DrawSequenceElement(Rect rect, int index, bool active, bool focused)
        {
            rect.SubVerticalRect(4f);
            Rect typeRect = rect.SubVerticalRect(EditorGUIUtility.singleLineHeight, 2f);
            SequenceElementType prevType = patternDefinition.sequence[index].type;

            patternDefinition.sequence[index].type = (SequenceElementType)EditorGUI.EnumPopup(typeRect, patternDefinition.sequence[index].type, styleBoldPopup);
            if (prevType != patternDefinition.sequence[index].type)
            {
                patternDefinition.sequence[index].ResetData();
            }
            for (int i = 0; i < patternDefinition.sequence[index].fields.Length; i++)
            {
                patternDefinition.sequence[index].fields[i].DrawField(rect.SubVerticalRect(EditorGUIUtility.singleLineHeight, 2f), patternDefinition.sequence[index].GetFieldName(i), patternDefinition);
            }
        }
Exemplo n.º 2
0
        public void changeType(SequenceElementType type)
        {
            switch (type)
            {
            case SequenceElementType.Activated:

                break;

            case SequenceElementType.Active:
                background = Brushes.LightSkyBlue;
                border     = Pens.IndianRed;
                break;

            case SequenceElementType.Built:
                background = Brushes.GreenYellow;
                border     = Pens.Purple;
                break;

            case SequenceElementType.Normal:
                background = Brushes.LightYellow;
                border     = Pens.Thistle;
                break;

            case SequenceElementType.Receptor:
                background = Brushes.LightCyan;
                fontColor  = Brushes.DarkSlateGray;
                border     = Pens.Purple;
                break;

            case SequenceElementType.ActiveReceptor:
                background = Brushes.PaleVioletRed;
                fontColor  = Brushes.DarkSlateBlue;
                border     = Pens.Purple;
                break;
            }
        }
Exemplo n.º 3
0
        public static SequenceElementTypeDef GetDef(this SequenceElementType type)
        {
            switch (type)
            {
            case SequenceElementType.Bullet:
                return(SequenceElementTypeDef.bullet);

            case SequenceElementType.Delay:
                return(SequenceElementTypeDef.delay);

            case SequenceElementType.EnablePoint:
                return(SequenceElementTypeDef.enablePoint);

            case SequenceElementType.DisablePoint:
                return(SequenceElementTypeDef.disablePoint);

            case SequenceElementType.Lazer:
                return(SequenceElementTypeDef.lazer);

            case SequenceElementType.Mortar:
                return(SequenceElementTypeDef.mortar);

            case SequenceElementType.SetRotationSpeed:
                return(SequenceElementTypeDef.setRotationSpeed);

            case SequenceElementType.SetRotationAbsolute:
                return(SequenceElementTypeDef.setRotationAbs);

            case SequenceElementType.Cone:
                return(SequenceElementTypeDef.cone);

            default:
                Debug.LogWarning("Sequence Element Type has undefined definition object!");
                return(new SequenceElementTypeDef());
            }
        }
Exemplo n.º 4
0
 public static string FieldIndexToName(this SequenceElementType type, int index)
 {
     return(type.GetDef().fieldNames[index]);
 }
Exemplo n.º 5
0
 public static int FieldNameToIndex(this SequenceElementType type, string name)
 {
     return(type.GetDef().GetFieldIndex(name));
 }
Exemplo n.º 6
0
 public static int GetFieldsCount(this SequenceElementType type)
 {
     return(type.GetDef().fieldCount);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Seq"/> class with the specified
 /// common element type and sequence <paramref name="kind"/>.
 /// Memory for the sequence will be allocated from the provided <paramref name="storage"/>.
 /// </summary>
 /// <param name="elementType">The type of elements in the sequence.</param>
 /// <param name="kind">The kind of sequence to create.</param>
 /// <param name="storage">The memory storage used to grow the sequence.</param>
 public Seq(SequenceElementType elementType, SequenceKind kind, MemStorage storage)
     : this((int)elementType, kind, SequenceFlags.Simple, storage)
 {
 }