Exemple #1
0
        /// Adds a LEFT/RIGHT JOIN part of the SQL query as FROM parts, while replacing corresponding FROM parts.
        ///
        /// If a subquery parts aggregator is open, redirects the call to it instead.
        public void AddOuterJoinPart(string outerMember, string innerMember)
        {
            if (_visitingSubQueryExpression)
            {
                _subQueryExpressionPartsAggregator.AddOuterJoinPart(outerMember, innerMember);
            }
            else
            {
                var outerSource   = outerMember.Split('.')[0];
                var innerSource   = innerMember.Split('.')[0];
                var groupJoinPart =
                    $"{outerSource} LEFT OUTER JOIN {innerSource} ON ({outerMember} = {innerMember})";

                // We're using the fact that the left source table was already added in AddFromPart
                var index = FromParts.IndexOf(outerSource);
                FromParts[index] = groupJoinPart;

                var groupingPart =
                    $"(SELECT COUNT(*) FROM {innerSource} AS \"temp_{innerSource.Substring(1)} " +
                    $"WHERE \"temp_{innerMember.Substring(1)} = {outerMember}) AS";
                if (SelectPart.Contains(groupingPart))
                {
                    OrderByParts.Add(outerMember);
                    OrderByParts.Add(innerMember);
                }
            }
        }
    // Use this for initialization
    void Awake()
    {
        //number of parts to fuse
        partCreated  = new bool[NUM_PARTS];
        instantiated = new GameObject[NUM_PARTS];
        for (int i = 0; i < NUM_PARTS; i++)
        {
            partCreated[i] = false;
        }
        for (int i = 0; i < NUM_PARTS; i++)
        {
            instantiated[i] = null;
        }
        createLoc        = new Vector3(-40, 25, 80);
        selectionManager = eventSystem.GetComponent <SelectPart>();

        //CHANGE this string to the name of your starting part
        startObject = GameObject.Find("vest_base_complete");

        //CHANGE these lines so they refer to each black part on your starting part
        GameObject rightStrapBackStrapAttach     = startObject.transform.FindChild("right_strap_back_strap_attach").gameObject;
        GameObject vestBaseLeftStrapBottomAttach = startObject.transform.FindChild("vest_base_left_strap_bottom_attach").gameObject;
        GameObject vestBaseLeftStrapTopAttach    = startObject.transform.FindChild("vest_base_left_strap_top_attach").gameObject;
        GameObject VestBaseVestDiamondAttach     = startObject.transform.FindChild("vest_base_vest_diamond_attach").gameObject;

        //to avoid errors when selectedObject starts as startObject
        //CHANGE these lines to match above
        rightStrapBackStrapAttach.GetComponent <FuseBehavior>().isFused     = true;
        vestBaseLeftStrapBottomAttach.GetComponent <FuseBehavior>().isFused = true;
        vestBaseLeftStrapTopAttach.GetComponent <FuseBehavior>().isFused    = true;
        VestBaseVestDiamondAttach.GetComponent <FuseBehavior>().isFused     = true;

        rotateGizmo = GameObject.FindGameObjectWithTag("RotationGizmo").GetComponent <RotationGizmo>();
    }
    // Use this for initialization
    void Awake()
    {
        //number of parts to fuse
        partCreated  = new bool[NUM_PARTS];
        instantiated = new GameObject[NUM_PARTS];
        for (int i = 0; i < NUM_PARTS; i++)
        {
            partCreated[i] = false;
        }
        for (int i = 0; i < NUM_PARTS; i++)
        {
            instantiated[i] = null;
        }
        createLoc        = new Vector3(-40, 25, 100);
        selectionManager = eventSystem.GetComponent <SelectPart>();
        startObject      = GameObject.Find("dangly_T_complete");

        //print (startObject.transform.FindChild ("dangly_T_upright_L_attach"));
        GameObject uprightLAttach     = startObject.transform.FindChild("dangly_T_upright_L_attach").gameObject;
        GameObject uprightTAttach     = startObject.transform.FindChild("dangly_T_upright_T_attach").gameObject;
        GameObject walkingPantsAttach = startObject.transform.FindChild("dangly_T_walking_pants_attach").gameObject;

        //to avoid errors when selectedObject starts as startObject
        uprightLAttach.GetComponent <FuseBehavior>().isFused     = true;
        uprightTAttach.GetComponent <FuseBehavior>().isFused     = true;
        walkingPantsAttach.GetComponent <FuseBehavior>().isFused = true;
        rotateGizmo = GameObject.FindGameObjectWithTag("RotationGizmo").GetComponent <RotationGizmo>();
    }
Exemple #4
0
    // Use this for initialization
    void Awake()
    {
        //number of parts to fuse
        partCreated  = new bool[NUM_PARTS];
        instantiated = new GameObject[NUM_PARTS];
        for (int i = 0; i < NUM_PARTS; i++)
        {
            partCreated[i] = false;
        }
        for (int i = 0; i < NUM_PARTS; i++)
        {
            instantiated[i] = null;
        }
        createLoc        = new Vector3(-40, 25, 80);
        selectionManager = eventSystem.GetComponent <SelectPart>();
        startObject      = GameObject.Find("postWhole");
        GameObject postHangingLAttach = startObject.transform.Find("post_hanging_l_attach").gameObject;
        GameObject postMiddleTAttach  = startObject.transform.Find("post_middle_t_attach").gameObject;
        GameObject postZigzagAttach   = startObject.transform.Find("post_zigzag_attach").gameObject;

        //to avoid errors when selectedObject starts as startObject
        postHangingLAttach.GetComponent <FuseBehavior>().isFused = true;
        postMiddleTAttach.GetComponent <FuseBehavior>().isFused  = true;
        postZigzagAttach.GetComponent <FuseBehavior>().isFused   = true;
        rotateGizmo = GameObject.FindGameObjectWithTag("RotationGizmo").GetComponent <RotationGizmo>();
    }
Exemple #5
0
    // Use this for initialization
    void Awake()
    {
        //number of parts to fuse
        partCreated  = new bool[NUM_PARTS];
        instantiated = new GameObject[NUM_PARTS];
        for (int i = 0; i < NUM_PARTS; i++)
        {
            partCreated[i] = false;
        }
        for (int i = 0; i < NUM_PARTS; i++)
        {
            instantiated[i] = null;
        }
        createLoc        = new Vector3(-40, 25, 100);
        selectionManager = eventSystem.GetComponent <SelectPart>();
        startObject      = GameObject.Find("tutorial1_box");
        GameObject boxPyrAttach  = startObject.transform.Find("box_pyr_attach").gameObject;
        GameObject boxTriAttach  = startObject.transform.Find("box_tri_attach").gameObject;
        GameObject boxConeAttach = startObject.transform.Find("box_cone_attach").gameObject;

        //to avoid errors when selectedObject starts as startObject
        boxPyrAttach.GetComponent <FuseBehavior>().isFused  = true;
        boxTriAttach.GetComponent <FuseBehavior>().isFused  = true;
        boxConeAttach.GetComponent <FuseBehavior>().isFused = true;

        rotateGizmo = GameObject.FindGameObjectWithTag("RotationGizmo").GetComponent <RotationGizmo>();
    }
Exemple #6
0
        public string BuildHQLString()
        {
            var stringBuilder = new StringBuilder();

            if (string.IsNullOrEmpty(SelectPart) || FromParts.Count == 0)
            {
                throw new InvalidOperationException("A query must have a select part and at least one from part.");
            }

            if (!SelectPart.Contains(".") && !SelectPart.Contains("count"))
            {
                SelectPart = SelectPart + ".*";
            }

            stringBuilder.AppendFormat("select {0}", SelectPart);
            stringBuilder.AppendFormat(" from {0}", StringUtility.Join <string>(", ", FromParts));

            if (WhereParts.Count > 0)
            {
                stringBuilder.AppendFormat(" where {0}", StringUtility.Join <string>(" and ", WhereParts));
            }

            if (GroupByParts.Count > 0)
            {
                stringBuilder.AppendFormat(" group by {0}", StringUtility.Join <string>(" , ", GroupByParts));
            }

            if (OrderByParts.Count > 0)
            {
                stringBuilder.AppendFormat(" order by {0}", StringUtility.Join <string>(", ", OrderByParts));
            }

            return(stringBuilder.ToString());
        }
Exemple #7
0
    // Use this for initialization
    void Awake()
    {
        //number of parts to fuse
        partCreated  = new bool[NUM_PARTS];
        instantiated = new GameObject[NUM_PARTS];
        for (int i = 0; i < NUM_PARTS; i++)
        {
            partCreated[i] = false;
        }
        for (int i = 0; i < NUM_PARTS; i++)
        {
            instantiated[i] = null;
        }
        createLoc        = new Vector3(-40, 25, 80);
        selectionManager = eventSystem.GetComponent <SelectPart>();

        //CHANGE this string to the name of your starting part
        startObject = GameObject.Find("bridgeWhole");

        //CHANGE these lines so they refer to each black part on your starting part
        GameObject bridgeBackAttach             = startObject.transform.Find("bridge_back_attach").gameObject;
        GameObject bridgeBridgeCoverLeftAttach  = startObject.transform.Find("bridge_bridge_cover_left_attach").gameObject;
        GameObject bridgeBridgeCoverRightAttach = startObject.transform.Find("bridge_bridge_cover_right_attach").gameObject;


        //to avoid errors when selectedObject starts as startObject
        //CHANGE these lines to match above
        bridgeBackAttach.GetComponent <FuseBehavior>().isFused             = true;
        bridgeBridgeCoverLeftAttach.GetComponent <FuseBehavior>().isFused  = true;
        bridgeBridgeCoverRightAttach.GetComponent <FuseBehavior>().isFused = true;
        rotateGizmo = GameObject.FindGameObjectWithTag("RotationGizmo").GetComponent <RotationGizmo>();
    }
Exemple #8
0
    // Use this for initialization
    void Awake()
    {
        //number of parts to fuse
        partCreated  = new bool[NUM_PARTS];
        instantiated = new GameObject[NUM_PARTS];
        for (int i = 0; i < NUM_PARTS; i++)
        {
            partCreated[i] = false;
        }
        for (int i = 0; i < NUM_PARTS; i++)
        {
            instantiated[i] = null;
        }
        createLoc        = new Vector3(-40, 25, 100);
        selectionManager = eventSystem.GetComponent <SelectPart>();

        //CHANGE this string to the name of your starting part
        startObject = GameObject.Find("startObject");

        //CHANGE these lines so they refer to each black part on your starting part
        GameObject shaftHaftAttach           = GameObject.Find("shaft_haft_attach");
        GameObject shaftSmallTrapezoidAttach = GameObject.Find("shaft_small_trapezoid_attach");
        GameObject shaftSpikeAttach          = GameObject.Find("shaft_spike_attach");
        GameObject shaftTrapezoidAttach      = GameObject.Find("shaft_trapezoid_attach");

        //to avoid errors when selectedObject starts as startObject
        //CHANGE these lines to match above
        shaftHaftAttach.GetComponent <FuseBehavior>().isFused           = true;
        shaftSmallTrapezoidAttach.GetComponent <FuseBehavior>().isFused = true;
        shaftSpikeAttach.GetComponent <FuseBehavior>().isFused          = true;
        shaftTrapezoidAttach.GetComponent <FuseBehavior>().isFused      = true;
        rotateGizmo = GameObject.FindGameObjectWithTag("RotationGizmo").GetComponent <RotationGizmo>();
    }
    // Use this for initialization
    void Awake()
    {
        //number of parts to fuse
        partCreated  = new bool[NUM_PARTS];
        instantiated = new GameObject[NUM_PARTS];
        for (int i = 0; i < NUM_PARTS; i++)
        {
            partCreated[i] = false;
        }
        for (int i = 0; i < NUM_PARTS; i++)
        {
            instantiated[i] = null;
        }
        createLoc        = new Vector3(-40, 25, 100);
        selectionManager = eventSystem.GetComponent <SelectPart>();

        //CHANGE this string to the name of your starting part
        startObject = GameObject.Find("tutorial2_longbox");

        //CHANGE these lines so they refer to each black part on your starting part
        GameObject longboxBigBoxAttach         = startObject.transform.FindChild("longbox_bigbox_attach").gameObject;
        GameObject longboxTallboxAttach        = startObject.transform.FindChild("longbox_tallbox_attach").gameObject;
        GameObject longboxSmallboxYellowAttach = startObject.transform.FindChild("longbox_smallbox_yellow_attach").gameObject;

        //to avoid errors when selectedObject starts as startObject
        //CHANGE these lines to match above
        //these lines may be unnecessary?
        longboxBigBoxAttach.GetComponent <FuseBehavior>().isFused         = true;
        longboxTallboxAttach.GetComponent <FuseBehavior>().isFused        = true;
        longboxSmallboxYellowAttach.GetComponent <FuseBehavior>().isFused = true;
        rotateGizmo = GameObject.FindGameObjectWithTag("RotationGizmo").GetComponent <RotationGizmo>();
    }
    // Use this for initialization
    void Awake()
    {
        //number of parts to fuse
        partCreated  = new bool[NUM_PARTS];
        instantiated = new GameObject[NUM_PARTS];
        for (int i = 0; i < NUM_PARTS; i++)
        {
            partCreated[i] = false;
        }
        for (int i = 0; i < NUM_PARTS; i++)
        {
            instantiated[i] = null;
        }
        createLoc        = new Vector3(-40, 25, 80);
        selectionManager = eventSystem.GetComponent <SelectPart>();

        //CHANGE this string to the name of your starting part
        startObject = GameObject.Find("block_juts_whole");

        //CHANGE these lines so they refer to each black part on your starting part
        //GameObject blockJutsCornerAttach = startObject.transform.FindChild("block_juts_corner_attach").gameObject;
        //GameObject blockJutsLongLBackAttach = startObject.transform.FindChild("block_juts_long_l_back_attach").gameObject;
        GameObject blockJutsLongLSideAttach = startObject.transform.FindChild("block_juts_long_l_side_attach").gameObject;
        GameObject blockJutsLongLTopAttach  = startObject.transform.FindChild("block_juts_long_l_top_attach").gameObject;



        //to avoid errors when selectedObject starts as startObject
        //CHANGE these lines to match above
        //blockJutsCornerAttach.GetComponent<FuseBehavior>().isFused = true;
        //blockJutsLongLBackAttach.GetComponent<FuseBehavior>().isFused = true;
        blockJutsLongLSideAttach.GetComponent <FuseBehavior>().isFused = true;
        blockJutsLongLTopAttach.GetComponent <FuseBehavior>().isFused  = true;
        rotateGizmo = GameObject.FindGameObjectWithTag("RotationGizmo").GetComponent <RotationGizmo>();
    }
    // Use this for initialization
    void Awake()
    {
        //number of parts to fuse
        partCreated  = new bool[NUM_PARTS];
        instantiated = new GameObject[NUM_PARTS];
        for (int i = 0; i < NUM_PARTS; i++)
        {
            partCreated[i] = false;
        }
        for (int i = 0; i < NUM_PARTS; i++)
        {
            instantiated[i] = null;
        }
        createLoc        = new Vector3(-40, 25, 80);
        selectionManager = eventSystem.GetComponent <SelectPart>();
        startObject      = GameObject.Find("centerBoxWhole");
        GameObject centerHandleBottomAttach = startObject.transform.FindChild("center_box_handle_bottom_attach").gameObject;
        GameObject centerHandleTopAttach    = startObject.transform.FindChild("center_box_handle_top_attach").gameObject;
        GameObject centerRingBackAttach     = startObject.transform.FindChild("center_box_ring_back_attach").gameObject;
        GameObject centerRingForwardAttach  = startObject.transform.FindChild("center_box_ring_forward_attach").gameObject;
        GameObject centerRingLeftAttach     = startObject.transform.FindChild("center_box_ring_left_attach").gameObject;
        GameObject centerRingRightAttach    = startObject.transform.FindChild("center_box_ring_right_attach").gameObject;


        //to avoid errors when selectedObject starts as startObject
        centerHandleBottomAttach.GetComponent <FuseBehavior>().isFused = true;
        centerHandleTopAttach.GetComponent <FuseBehavior>().isFused    = true;
        centerRingBackAttach.GetComponent <FuseBehavior>().isFused     = true;
        centerRingForwardAttach.GetComponent <FuseBehavior>().isFused  = true;
        centerRingLeftAttach.GetComponent <FuseBehavior>().isFused     = true;
        centerRingRightAttach.GetComponent <FuseBehavior>().isFused    = true;

        rotateGizmo = GameObject.FindGameObjectWithTag("RotationGizmo").GetComponent <RotationGizmo>();
    }
        private void WithCurrentPart(SelectPart part, Action handle)
        {
            var oldPart = currentPart;

            currentPart = part;
            handle();
            currentPart = oldPart;
        }
        public QueryField GetOrCreateQueryField(ColumnReferenceExpression columnReference,
                                                bool isRepresentation, SelectPart selectPart)
        {
            var queryRoot = queryEntityRegistry.Get(columnReference.Table);

            if (!isRepresentation && selectPart == SelectPart.GroupBy)
            {
                QueryField fieldWithFunction;
                var        keyWithFunction = columnReference.Name + "." + true;
                if (queryRoot.fields.TryGetValue(keyWithFunction, out fieldWithFunction))
                {
                    if (fieldWithFunction.parts.Contains(SelectPart.Select))
                    {
                        isRepresentation = true;
                    }
                }
            }
            var        key = columnReference.Name + "." + isRepresentation;
            QueryField field;

            if (!queryRoot.fields.TryGetValue(key, out field))
            {
                var propertyNames    = columnReference.Name.Split('.');
                var subqueryRequired = propertyNames.Length > 1;
                var needInvert       = false;
                if (propertyNames[propertyNames.Length - 1].EqualsIgnoringCase("ЭтоГруппа"))
                {
                    needInvert       = true;
                    subqueryRequired = true;
                }
                var propertiesEnumerator = new PropertiesEnumerator(propertyNames, queryRoot, this);
                var referencedProperties = propertiesEnumerator.Enumerate();
                if (isRepresentation)
                {
                    if (ReplaceWithRepresentation(referencedProperties))
                    {
                        subqueryRequired = true;
                    }
                }
                string fieldAlias = null;
                if (subqueryRequired)
                {
                    queryRoot.subqueryRequired = true;
                    fieldAlias = nameGenerator.GenerateColumnName();
                }
                foreach (var p in referencedProperties)
                {
                    p.referenced = true;
                }
                field = new QueryField(fieldAlias, referencedProperties.ToArray(), needInvert);
                queryRoot.fields.Add(key, field);
            }
            if (!field.parts.Contains(selectPart))
            {
                field.parts.Add(selectPart);
            }
            return(field);
        }
Exemple #14
0
 void Awake()
 {
     eventSystem        = GameObject.Find("EventSystem");
     rotationGizmo      = GameObject.Find("RotationGizmo");
     rotationScript     = rotationGizmo.GetComponent <RotationGizmo>();
     selectPart         = eventSystem.GetComponent <SelectPart>();
     fuseEvent          = eventSystem.GetComponent <FuseEvent>();
     conversationSystem = GameObject.Find("ConversationSystem");
 }
Exemple #15
0
        private void AddConditionButtonClick(object sender, EventArgs e)
        {
            var item = (QueryConstructorSelectProperty)SelectPart.AddItem();

            item.OnDeleteItem    = OnDeleteQuery;
            item.PathResolveType = PathResolveType.Select;

            item.Caption = "Field to Select";
            ReloadWherePaths(new[] { item });
        }
Exemple #16
0
        /// <summary>
        /// Constrói o resultado com as informações que serão processadas.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        public override QueryReturnInfo BuildResultInfo <T>(GDA.Interfaces.IProviderConfiguration configuration)
        {
            if (string.IsNullOrEmpty(_commandText))
            {
                throw new QueryException("Command text not informed.");
            }
            var query = _commandText;

            if (!string.IsNullOrEmpty(Order))
            {
                var orderByIndex = query.LastIndexOf("ORDER BY");
                if (orderByIndex >= 0)
                {
                    query = query.Substring(0, orderByIndex);
                }
                query += " ORDER BY " + Order;
            }
            var mapping     = MappingManager.GetMappers <T>(null, null);
            var selectProps = new List <Mapper>(mapping);

            if (!string.IsNullOrEmpty(_selectProperties) && _selectProperties != "*")
            {
                List <string> functions = new List <string>();
                Parser        p         = new Parser(new Lexer(_selectProperties));
                SelectPart    sp        = p.ExecuteSelectPart();
                selectProps = new List <Mapper>(sp.SelectionExpressions.Count);
                foreach (SelectExpression se in sp.SelectionExpressions)
                {
                    if (se.ColumnName.Type == GDA.Sql.InterpreterExpression.Enums.SqlExpressionType.Column)
                    {
                        Column col = se.Column;
                        foreach (Mapper mp in mapping)
                        {
                            if (string.Compare(se.ColumnName.Value.Text, mp.PropertyMapperName, true) == 0 && (mp.Direction == DirectionParameter.Input || mp.Direction == DirectionParameter.InputOutput || mp.Direction == DirectionParameter.OutputOnlyInsert))
                            {
                                if (!selectProps.Exists(f => f.PropertyMapperName == mp.PropertyMapperName))
                                {
                                    selectProps.Add(mp);
                                }
                            }
                        }
                        if (col.Name == "*")
                        {
                            throw new GDAException("Invalid expression {0}", se.ColumnName.Value.Text);
                        }
                    }
                    else if (se.ColumnName.Type == GDA.Sql.InterpreterExpression.Enums.SqlExpressionType.Function)
                    {
                        throw new QueryException("NativeQuery not support function in select part");
                    }
                }
            }
            return(new QueryReturnInfo(query, this.Parameters, selectProps));
        }
 private void PartOfSpeechCOM_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (count > 0)
     {
         SelectPart.Invoke(sender, e);
         Key.Invoke(sender, e);
     }
     else
     {
         count++;
     }
 }
Exemple #18
0
        /// Wraps the SELECT part of a query using a format string provided in the argument.
        ///
        /// If a subquery parts aggregator is open, redirects the call to it instead.
        public void SetSelectPartAsScalar(string scalarPartFormat)
        {
            if (_visitingSubQueryExpression)
            {
                _subQueryExpressionPartsAggregator.SetSelectPartAsScalar(scalarPartFormat);
            }
            else
            {
                var renamingPartIndex = SelectPart.IndexOf("\" AS \"", StringComparison.Ordinal) + 1;
                SelectPart = renamingPartIndex > 0 ? SelectPart.Substring(0, renamingPartIndex) : SelectPart;

                SelectPart = string.Format(scalarPartFormat, SelectPart);
            }
        }
Exemple #19
0
    // Use this for initialization
    void Start()
    {
        triggersFinished = new bool[NUM_TRIGGERS];
        for (int i = 0; i < NUM_TRIGGERS; i++)
        {
            triggersFinished[i] = false;
        }

        selectPart = eventSystem.GetComponent <SelectPart>();
        fuseEvent  = eventSystem.GetComponent <FuseEvent>();
        ConversationTrigger.RemoveToken("blockTutorial2Start");
        conversationSystem = GameObject.Find("ConversationSystem");
        done = false;
    }
Exemple #20
0
        public string ToSql(SqlGenerator generator)
        {
            var sb = new StringBuilder();

            sb.Append("Select ");
            if (SelectPart.Any())
            {
                sb = SelectPart.Aggregate(sb, (s, i) => s.AppendFormat("{0},", i.ToSql(generator)));
                sb.Remove(sb.Length - 1, 1);
            }
            else
            {
                sb.Append("*");
            }
            sb.Append(" From ");
            sb = FromPart.Aggregate(sb, (s, i) => s.AppendFormat("{0} ", i.ToSql(generator)));

            if (WherePart != null)
            {
                sb.AppendFormat("Where {0}", WherePart.ToSql(generator));
            }

            if (GroupPart.Any())
            {
                sb.Append(" Group By ");
                sb = GroupPart.Aggregate(sb, (s, o) => s.AppendFormat("{0},", o.ToSql(generator, false)));
                sb.Remove(sb.Length - 1, 1);
            }

            if (OrderPart.Any())
            {
                sb.Append(" Order By ");
                sb = OrderPart.Aggregate(sb, (s, o) => s.AppendFormat("{0},", o.ToSql(generator)));
                sb.Remove(sb.Length - 1, 1);
            }

            if (Take.HasValue)
            {
                sb.Append(" limit ");
                if (Skip.HasValue)
                {
                    sb.AppendFormat("{0},", Skip.Value);
                }
                sb.Append(Take.Value);
            }

            return(sb.ToString());
        }
Exemple #21
0
    void OnEnable()
    {
        tooltipsEnabled = false;

        rotationScript    = rotationGizmo.GetComponent <RotationGizmo>();
        fuseEvent         = eventSystem.GetComponent <FuseEvent>();
        selectPart        = eventSystem.GetComponent <SelectPart>();
        cameraControls    = mainCam.GetComponent <CameraControls>();
        baseStartPosition = new Vector3(-100, 30, 100);

        fuseEvent.setIsFirstLevel(true);

        partButtons    = new Button[3];
        partButtons[0] = b1p1Button;
        partButtons[1] = b1p2Button;
        partButtons[2] = b1p3Button;

        // tooltips occur on: all part buttons, Fuse button, Finished Image, bb1 child
        allTooltips     = new Tooltip[16];
        allTooltips[0]  = b1p1Button.gameObject.GetComponent <Tooltip>();
        allTooltips[1]  = b1p2Button.gameObject.GetComponent <Tooltip>();
        allTooltips[2]  = b1p3Button.gameObject.GetComponent <Tooltip>();
        allTooltips[3]  = finishedImage.GetComponent <Tooltip>();
        allTooltips[4]  = fuseButton.gameObject.GetComponent <Tooltip>();
        allTooltips[5]  = bb1.GetComponent <Tooltip>();
        allTooltips[6]  = yUp.GetComponent <Tooltip>();
        allTooltips[7]  = yDown.GetComponent <Tooltip>();
        allTooltips[8]  = xUp.GetComponent <Tooltip>();
        allTooltips[9]  = xDown.GetComponent <Tooltip>();
        allTooltips[10] = zUp.GetComponent <Tooltip>();
        allTooltips[11] = zDown.GetComponent <Tooltip>();
        allTooltips[12] = bb1_b1p1_a1.GetComponent <Tooltip>();
        allTooltips[13] = bb1_b1p2_a1.GetComponent <Tooltip>();
        allTooltips[14] = bb1_b1p2_a2.GetComponent <Tooltip>();
        allTooltips[15] = bb1_b1p3_a1.GetComponent <Tooltip>();

        //make sure all tooltips are disabled on startup
        for (int i = 0; i < allTooltips.Length; i++)
        {
            allTooltips[i].enabled = false;
        }
    }
Exemple #22
0
    // Use this for initialization
    void Awake()
    {
        //number of parts to fuse
        partCreated  = new bool[NUM_PARTS];
        instantiated = new GameObject[NUM_PARTS];
        for (int i = 0; i < NUM_PARTS; i++)
        {
            partCreated[i] = false;
        }
        for (int i = 0; i < NUM_PARTS; i++)
        {
            instantiated[i] = null;
        }
        createLoc          = new Vector3(-40, 25, 100);
        offscreenCreateLoc = new Vector3(-40, -60, 100);
        selectionManager   = eventSystem.GetComponent <SelectPart>();
        startObject        = GameObject.Find("bb3Start");

        rotateGizmo = GameObject.FindGameObjectWithTag("RotationGizmo").GetComponent <RotationGizmo>();
    }
Exemple #23
0
    // Use this for initialization
    void Awake()
    {
        //number of parts to fuse
        partCreated  = new bool[NUM_PARTS];
        instantiated = new GameObject[NUM_PARTS];
        for (int i = 0; i < NUM_PARTS; i++)
        {
            partCreated[i] = false;
        }
        for (int i = 0; i < NUM_PARTS; i++)
        {
            instantiated[i] = null;
        }
        createLoc        = new Vector3(-40, 25, 100);
        selectionManager = eventSystem.GetComponent <SelectPart>();
        startObject      = GameObject.Find("rocket_boots_start");
        rotateGizmo      = GameObject.FindGameObjectWithTag("RotationGizmo").GetComponent <RotationGizmo>();

        ConversationTrigger.AddToken("beginRocketBoots");
    }
    // Use this for initialization
    void Start()
    {
        triggersFinished = new bool[NUM_TRIGGERS];
        for (int i = 0; i < NUM_TRIGGERS; i++)
        {
            triggersFinished[i] = false;
        }

        rotationScript     = rotationGizmo.GetComponent <RotationGizmo>();
        fuseEvent          = eventSystem.GetComponent <FuseEvent>();
        selectPart         = eventSystem.GetComponent <SelectPart>();
        partButtonClicked  = false;
        conversationSystem = GameObject.Find("ConversationSystem");
        done = false;

        //disable part buttons so player can't use them while Dresha talks
        foreach (Button b in partButtons)
        {
            b.interactable = false;
        }
        //disable clicking on black regions while Dresha talks
        //could throw error if any of the objects in attachments do not have a MeshCollider or BoxCollider
        foreach (GameObject a in attachments)
        {
            BoxCollider bcollide = a.GetComponent <BoxCollider>();
            if (bcollide == null)
            {
                a.GetComponent <MeshCollider>().enabled = false;
            }
            else
            {
                bcollide.enabled = false;
            }
        }
        SimpleData.WriteStringToFile("LeapData.txt", "***This is another try at " + DateTime.Now.ToString() + ".");
        LeapStatic.resetConstructionObject("tutorial1");
    }
    // Use this for initialization
    void Awake()
    {
        //number of parts to fuse
        partCreated  = new bool[NUM_PARTS];
        instantiated = new GameObject[NUM_PARTS];
        for (int i = 0; i < NUM_PARTS; i++)
        {
            partCreated[i] = false;
        }
        for (int i = 0; i < NUM_PARTS; i++)
        {
            instantiated[i] = null;
        }
        createLoc        = new Vector3(-40, 25, 80);
        selectionManager = eventSystem.GetComponent <SelectPart>();
        startObject      = GameObject.Find("armWhole");
        GameObject armArmDecAttach = startObject.transform.FindChild("arm_arm_dec_attach").gameObject;
        GameObject armPalmAttach   = startObject.transform.FindChild("arm_palm_attach").gameObject;

        //to avoid errors when selectedObject starts as startObject
        armArmDecAttach.GetComponent <FuseBehavior>().isFused = true;
        armPalmAttach.GetComponent <FuseBehavior>().isFused   = true;
        rotateGizmo = GameObject.FindGameObjectWithTag("RotationGizmo").GetComponent <RotationGizmo>();
    }
Exemple #26
0
 private void OnDeleteQuery(Control control)
 {
     SelectPart.DeleteItem(control);
 }
Exemple #27
0
 public void setSelectPartScript(SelectPart selectPart)
 {
     this.selectPart = selectPart;
 }
        protected void Select_List()
        {

            SelectPart.Add("r.logId,r.requestIP,r.tag,r.createTime,r.subKey");
            
        }
        protected void Select_TimeLine()
        {

            SelectPart.Add("r.url,r.requestIP,r.serverIP,r.createTime,r.subKey,r.exceptionMessage,r.tag,r.logId");

        }
Exemple #30
0
 void OnEnable()
 {
     convoController = GameObject.Find("ConversationSystem").GetComponent <ConversationController>();
     selectPart      = GameObject.Find("EventSystem").GetComponent <SelectPart>();
     Debug.Log("setting convoController and selectPart variables for " + gameObject + "!");
 }