コード例 #1
0
        static VersionCheckerEvent()
        {
            if (Application.isBatchMode)
            {
                return;
            }

            CreatorProjectSettings settings = CreatorProjectSettings.Load();

            if (settings == null || string.IsNullOrEmpty(settings.ProjectCreatorVersion))
            {
                return;
            }

            if (settings.ProjectCreatorVersion == unknownVersionString || EditorUtils.GetCoreVersion() == unknownVersionString)
            {
                return;
            }

            if (settings.ProjectCreatorVersion != EditorUtils.GetCoreVersion())
            {
                IAnalyticsTracker tracker = AnalyticsUtils.CreateTracker();
                tracker.Send(new AnalyticsEvent()
                {
                    Category = "creator", Action = "updated", Label = EditorUtils.GetCoreVersion()
                });
                settings.ProjectCreatorVersion = EditorUtils.GetCoreVersion();
                settings.Save();
            }
        }
コード例 #2
0
        protected override void InternalDraw(string searchContext)
        {
            GUILayout.Label("Help Us! Contribute to Improvements!", CreatorEditorStyles.Header);
            GUILayout.Box(
                "Innoactive Creator is actively evolving. Please, help us with your feedback. Provide us your <b>anonymous</b> usage data and contribute to improvements.",
                CreatorEditorStyles.Paragraph);

            GUILayout.Label("We Respect Your Privacy", CreatorEditorStyles.Header);
            GUILayout.Box(
                "We DO NOT collect any sensitive information such as source code, file names or your courses' structure.\n\nHere is what we collect:\n- exact version of Innoactive Creator\n- exact version of Unity\n- your system's language\n- information about usage of the Innoactive Creator's components\n\nIn order to collect the information above, we store a unique identifier within Unity's Editor Preferences. Your data is anonymized.",
                CreatorEditorStyles.Paragraph);

            GUILayout.Label("We Are Transparent", CreatorEditorStyles.Header);
            GUILayout.Box(
                "The Innoactive Creator is open-source. Feel free to check our analytics code in <b>Core/Editor/Analytics</b>\n\nIf you want to opt-out of tracking choose <i>disabled</i> from the drop-down menu.",
                CreatorEditorStyles.Paragraph);

            CreatorGUILayout.DrawLink("Data Privacy Information", AnalyticsUtils.ShowDataPrivacyStatement);

            GUILayout.Space(16);

            // Unknown should not be shown, so we have to remove it.
            int state = (int)AnalyticsUtils.GetTrackingState() - 1;

            string[] labels = { "Disabled", "Enabled" };

            int newState = EditorGUILayout.Popup("Analytics Tracking", state, labels, CreatorEditorStyles.Popup);

            if (newState != state)
            {
                AnalyticsUtils.SetTrackingTo((AnalyticsState)Enum.ToObject(typeof(AnalyticsState), newState + 1));
            }
        }
コード例 #3
0
 public override void Apply()
 {
     if (AnalyticsUtils.GetTrackingState() == AnalyticsState.Unknown)
     {
         AnalyticsUtils.SetTrackingTo(AnalyticsState.Enabled);
     }
 }
コード例 #4
0
        public void OnSkillListItemLearnBtnClick(Evt evt)
        {
            var skillId = (int)evt.Data;

            AnalyticsUtils.AddCategorizedEventParam("Id", skillId);
            LogEvent("Skill.Learn");
        }
コード例 #5
0
ファイル: XRSDKSetupPage.cs プロジェクト: VaLiuM09/Creator
        /// <inheritdoc/>
        public override void Closing(bool isCompleted)
        {
            if (isCompleted && wasApplied)
            {
                AnalyticsEvent hardwareSelectedEvent = new AnalyticsEvent
                {
                    Category = "creator",
                    Action   = "hardware_selected",
                    Label    = selectedLoader == XRLoader.Other ? otherHardwareText : selectedLoader.ToString()
                };

                AnalyticsUtils.CreateTracker().Send(hardwareSelectedEvent);

                switch (selectedLoader)
                {
                case XRLoader.Oculus:
                    XRLoaderHelper.LoadOculus();
                    break;

                case XRLoader.OpenVR:
                    XRLoaderHelper.LoadOpenVR();
                    break;

                case XRLoader.WindowsMR:
                    XRLoaderHelper.LoadWindowsMR();
                    break;
                }
            }
        }
コード例 #6
0
 public void OnPreLevelComplete(Evt evt)
 {
     AnalyticsUtils.AddEventParam(
         "Player.TotalLifetime", (int)player.TotalLifetime);
     AddPlayerActionsPerMinuteRank();
     AddPlayerDeaths();
     LogEvent("Level.Completion");
 }
コード例 #7
0
ファイル: SynthesisUtils.cs プロジェクト: xiaodelea/synthesis
 /// <summary>
 /// Open Synthesis to a specific robot and field.
 /// </summary>
 public static void OpenSynthesis(string robotName)
 {
     if (robotName != null)
     {
         Process.Start(SynthesisPath, $"-robot \"{RobotExporterAddInServer.Instance.AddInSettingsManager.ExportPath + "\\" + robotName}\"");
         AnalyticsUtils.LogEvent("System", "Launched Synthesis");
     }
 }
コード例 #8
0
        private void LogEvent(string name)
        {
            PlayerState playerState = playerStateStorage.Get();

            AnalyticsUtils.AddCategorizedEventParam(
                "Level", playerState == null ? 0 : playerState.Level);
            AnalyticsUtils.LogEvent(name);
        }
コード例 #9
0
ファイル: ExportForm.cs プロジェクト: xiaodelea/synthesis
        public ExportForm(string initialRobotName)
        {
            InitializeComponent();
            AnalyticsUtils.LogPage("Pre-Export Form");
            InitializeFields();

            RobotNameTextBox.Text = initialRobotName;
            ColorBox.Checked      = RobotExporterAddInServer.Instance.AddInSettingsManager.DefaultExportWithColors;
        }
コード例 #10
0
        public JointSensorEditorForm(SkeletalJoint_Base passJoint, int sourceIndex = -1)
        {
            InitializeComponent();
            AnalyticsUtils.LogPage("Advanced Joint Editor / Sensor List", "Sensor Editor");
            this.sourceIndex = sourceIndex;
            joint            = passJoint;
            typeBox.Items.Clear();
            sensorTypeOptions = RobotSensor.GetAllowedSensors(joint);
            foreach (RobotSensorType sensorType in sensorTypeOptions)
            {
                typeBox.Items.Add(char.ToUpper(Enum.GetName(typeof(RobotSensorType), sensorType).Replace('_', ' ')[0])
                                  + Enum.GetName(typeof(RobotSensorType), sensorType).Replace('_', ' ').Substring(1).ToLower());
            }
            Console.WriteLine(sourceIndex >= 0 && sourceIndex < joint.attachedSensors.Count);
            base.Text = (sourceIndex >= 0 && sourceIndex < joint.attachedSensors.Count) ? ("Editing Sensor # " + sourceIndex) : "New Sensor";
            if (sourceIndex >= 0 && sourceIndex < joint.attachedSensors.Count)
            {
                RobotSensor sensor = joint.attachedSensors[sourceIndex];
                typeBox.SelectedIndex         = Array.IndexOf(sensorTypeOptions, sensor.type);
                PortANumericUpDown.Value      = (decimal)sensor.portA;
                PortBNumericUpDown.Value      = (decimal)sensor.portB;
                ConversionNumericUpDown.Value = (decimal)sensor.conversionFactor;
            }
            switch (joint.GetJointType())
            {
            case SkeletalJointType.ROTATIONAL:
                this.ConversionLbl.Text = "Counts Per Rev";
                break;

            case SkeletalJointType.LINEAR:
                this.ConversionLbl.Text = "Counts Per Inch";
                break;

            case SkeletalJointType.CYLINDRICAL:
                this.ConversionLbl.Text = "Counts Per Rev";
                break;
            }
            if (typeBox.SelectedIndex == 0)
            {
                this.PortALbl.Enabled                = true;
                this.PortANumericUpDown.Enabled      = true;
                this.PortBLbl.Visible                = true;
                this.PortBNumericUpDown.Visible      = true;
                this.ConversionLbl.Visible           = true;
                this.ConversionNumericUpDown.Visible = true;
            }
            else
            {
                this.PortALbl.Enabled                = false;
                this.PortANumericUpDown.Enabled      = false;
                this.PortBLbl.Visible                = false;
                this.PortBNumericUpDown.Visible      = false;
                this.ConversionLbl.Visible           = false;
                this.ConversionNumericUpDown.Visible = false;
            }
        }
コード例 #11
0
ファイル: JointCardUC.cs プロジェクト: xiaodelea/synthesis
 private void AdvancedButton_Click(object sender, EventArgs e)
 {
     if ((string)jointTypeComboBox.SelectedItem == "(Select an option)")
     {
         return;
     }
     AnalyticsUtils.LogPage("Joint Editor", "Optional Settings Editor");
     advancedSettingsForm.DoLayout((string)jointTypeComboBox.SelectedItem == "Drivetrain Wheel");
     advancedSettingsForm.ShowDialog();
 }
コード例 #12
0
        public JointSensorListForm(SkeletalJoint_Base passJoint)
        {
            AnalyticsUtils.LogPage("Advanced Joint Editor", "Sensor List");
            InitializeComponent();

            joint = passJoint;
            this.UpdateSensorList();

            base.Location = new System.Drawing.Point(Cursor.Position.X - 10, Cursor.Position.Y - base.Height - 10);
        }
コード例 #13
0
        private void AddPlayerLevelCompletionPercentage()
        {
            int level = playerStateStorage.Get().Level;
            int levelCompletionScore =
                levelSettingsStorage.Get(level).CompletionScore;
            int levelCompletionPercentage =
                player.Score * 10 / levelCompletionScore;

            AnalyticsUtils.AddCategorizedEventParam(
                "Player.LevelCompletionPercentage", levelCompletionPercentage);
        }
コード例 #14
0
 public void StartGame()
 {
     if (Gameboard.pictureData == null)
     {
         if (this.Error != null)
         {
             this.Error(Gameboard.LoadError.Unknown);
         }
         Gameboard.pictureData = null;
         return;
     }
     this.currentGUID = AnalyticsUtils.GenerateGUID();
     if (this.Create(Gameboard.pictureData))
     {
         Gameboard.LaunchCount++;
         if (this.Loaded != null)
         {
             this.Loaded();
         }
     }
     if (Gameboard.StartAnalyticEvent != null)
     {
         Gameboard.StartEventType type = Gameboard.StartAnalyticEvent.type;
         if (type != Gameboard.StartEventType.New)
         {
             if (type != Gameboard.StartEventType.Restart)
             {
                 if (type == Gameboard.StartEventType.Continue)
                 {
                     AnalyticsManager.ContinuePic(Gameboard.StartAnalyticEvent.id, Gameboard.StartAnalyticEvent.progress, Gameboard.StartAnalyticEvent.screenFrom, this.paintFill.TexWidth, Gameboard.pictureData.FillType);
                 }
             }
             else
             {
                 AnalyticsManager.RestartPic(Gameboard.StartAnalyticEvent.id, Gameboard.StartAnalyticEvent.progress, Gameboard.StartAnalyticEvent.screenFrom, this.paintFill.TexWidth, Gameboard.pictureData.FillType);
             }
         }
         else
         {
             AnalyticsManager.StartNewColoring(Gameboard.StartAnalyticEvent.id, this.paintFill.TexWidth, Gameboard.pictureData.FillType);
             if (Gameboard.pictureData.PicClass == PicClass.FacebookGift)
             {
                 AnalyticsManager.BonusPictureStartColoring(Gameboard.pictureData.Id);
             }
             else if (Gameboard.pictureData.PicClass == PicClass.Daily)
             {
                 AnalyticsManager.DailyStartColoring(Gameboard.pictureData.Id);
             }
         }
         Gameboard.StartAnalyticEvent = null;
     }
     AnalyticsManager.LevelTryStarted(Gameboard.pictureData.Id, this.currentGUID);
 }
コード例 #15
0
        protected override void OnEnvironmentClose()
        {
            Application.UserInterfaceManager.UserInteractionDisabled = true;
            var loadingBar = new LoadingBar("Closing Export Environment...");

            loadingBar.SetProgress(new ProgressUpdate("Saving Robot Data...", 3, 5));
            loadingBar.Show();
            RobotDataManager.SaveRobotData(OpenAssemblyDocument);
            loadingBar.Close();
            Application.UserInterfaceManager.UserInteractionDisabled = false;

            if (!RobotDataManager.wasForceQuit)
            {
                var exportResult = MessageBox.Show(new Form {
                    TopMost = true
                },
                                                   "The robot configuration has been saved to your assembly document.\nWould you like to export your robot to Synthesis?",
                                                   "Robot Configuration Complete",
                                                   MessageBoxButtons.YesNo);

                if (exportResult == DialogResult.Yes)
                {
                    UnsupportedComponentsForm.CheckUnsupportedComponents(RobotDataManager.RobotBaseNode.ListAllNodes());
                    if (ExportForm.PromptExportSettings(RobotDataManager))
                    {
                        if (RobotDataManager.ExportRobot())
                        {
                            AnalyticsUtils.LogEvent("Export", "Succeeded");
                            if (Instance.AddInSettingsManager.OpenSynthesis)
                            {
                                SynthesisUtils.OpenSynthesis(RobotDataManager.RobotName);
                            }
                        }
                        else
                        {
                            AnalyticsUtils.LogEvent("Export", "Cancelled");
                        }
                    }
                }
            }

            // Re-enable disabled components
            if (disabledAssemblyOccurrences != null)
            {
                InventorUtils.EnableComponents(disabledAssemblyOccurrences);
            }
            disabledAssemblyOccurrences = null;

            advancedJointEditor.DestroyDockableWindow();
            guideManager.DestroyDockableWindow();
            jointViewKey.DestroyDockableWindow();
            AnalyticsUtils.EndSession();
        }
コード例 #16
0
        /// <inheritdoc />
        public void RecordCustomEvent(string eventType, Dictionary <string, object> eventData)
        {
            try
            {
                //Every event has an embedded properties structure
                //First we will build the Properties structure
                //Then we will build the encapsulating event structure
                TrackPropertyBuilder propertyBuilder = new TrackPropertyBuilder();
                propertyBuilder.SetCategory(eventType);

                //Now build the properties structure and add the
                //custom properties received
                Dictionary <string, object> customProperties = propertyBuilder.Build();
                Dictionary <string, object> eventProps       = AnalyticsUtils.FoolProofParams(eventData);
                foreach (var key in eventProps.Keys)
                {
                    customProperties.Add(key, eventProps[key]);
                }

                //Now build the event structure
                RudderElementBuilder elementBuilder = new RudderElementBuilder();
                elementBuilder.WithEventName(eventType);

                //Set user id if available
                if (WynnEngine.PlayerId.HasValue())
                {
                    elementBuilder.WithUserId(WynnEngine.PlayerId);
                }

                //Set the user properties
                elementBuilder.WithUserProperties(GetCommonEventData());

                //Set the event properties
                elementBuilder.WithEventProperties(customProperties);

                // Create the event object
                RudderElement element = elementBuilder.Build();

                // Set the integrations
                element.integrations = new Dictionary <string, object>();
                element.integrations.Add("All", true);

                //Invoke track method
                rudder.Track(element);

                // GameEngine.LogError("RudderAnalyticsManager: Track: " + eventType);
            }
            catch (Exception e)
            {
                GameEngine.LogError("RudderAnalyticsManager: Track: Error: " + e.Message);
            }
        }
コード例 #17
0
        protected override void OnEnvironmentOpen()
        {
            AnalyticsUtils.StartSession();

            Application.UserInterfaceManager.UserInteractionDisabled = true;
            var loadingBar = new LoadingBar("Loading Export Environment...");

            loadingBar.SetProgress(new ProgressUpdate("Preparing UI Managers...", 1, 10));
            loadingBar.Show();
            HighlightManager.EnvironmentOpening(OpenAssemblyDocument);

            // Disable non-jointed components
            disabledAssemblyOccurrences = new List <ComponentOccurrence>();
            disabledAssemblyOccurrences.AddRange(InventorUtils.DisableUnconnectedComponents(OpenAssemblyDocument));

            loadingBar.SetProgress(new ProgressUpdate("Loading Robot Skeleton...", 2, 10));
            // Load robot skeleton and prepare UI
            RobotDataManager = new RobotDataManager();
            if (!RobotDataManager.LoadRobotSkeleton(new Progress <ProgressUpdate>(loadingBar.SetProgress)))
            {
                loadingBar.Close();
                Application.UserInterfaceManager.UserInteractionDisabled = false;
                InventorUtils.ForceQuitExporter(OpenAssemblyDocument);
                return;
            }

            if (RobotDataManager.wasForceQuit)
            {
                return;
            }

            loadingBar.SetProgress(new ProgressUpdate("Loading Joint Data...", 7, 10));
            RobotDataManager.LoadRobotData(OpenAssemblyDocument);

            loadingBar.SetProgress(new ProgressUpdate("Initializing UI...", 8, 10));
            // Create dockable window UI
            var uiMan = Application.UserInterfaceManager;

            advancedJointEditor.CreateDockableWindow(uiMan);
            jointViewKey.Init(uiMan);
            guideManager.Init(uiMan);

            guideManager.Visible = AddInSettingsManager.ShowGuide;

            loadingBar.SetProgress(new ProgressUpdate("Loading Robot Skeleton...", 9, 10));
            // Load skeleton into joint editors
            advancedJointEditor.LoadRobot(RobotDataManager);
            jointEditorForm.LoadRobot(RobotDataManager);
            loadingBar.Close();
            Application.UserInterfaceManager.UserInteractionDisabled = false;
        }
コード例 #18
0
 /// <summary>
 /// Save the form's values in a <see cref="AddInSettingsManager"/> structure
 /// </summary>
 private void SaveValues()
 {
     if (values.ShowGuide != checkBox2.Checked)
     {
         AnalyticsUtils.LogEvent("Settings", "Guide Toggle", checkBox2.Checked ? "Enabled" : "Disabled");
     }
     if (!values.JointHighlightColor.Equals(ChildHighlight.BackColor))
     {
         AnalyticsUtils.LogEvent("Settings", "Highlight Color Changed");
     }
     values.JointHighlightColor = ChildHighlight.BackColor;
     values.UseAnalytics        = checkBox1.Checked;
     values.ShowGuide           = checkBox2.Checked;
 }
コード例 #19
0
 private void onAdLoadedEvent(string adUnit, float height)
 {
     this.currentBannerGUID    = AnalyticsUtils.GenerateGUID();
     this.userBannerImpression = true;
     FMLogger.vAds("onAdLoadedEvent. height: " + height);
     if (this.bannerVisable)
     {
         this.userBannerImpression = false;
         AnalyticsManager.BannerImpression(this.bannerAdUnit, this.currentBannerGUID, AdsManager.Instance.IsTabletAdUnit, this.bannerPosition == MoPubBase.AdPosition.BottomCenter);
     }
     else
     {
         FMLogger.vAds("hide banner loaded event. workaround");
         MoPubAndroid.ShowBanner(this.bannerAdUnit, false);
     }
 }
コード例 #20
0
        /// <summary>
        /// The <see cref="JointEditorEvent"/> to open up a <see cref="JointDriverEditorForm"/> dialog
        /// </summary>
        /// <param name="node">The node connected to the joint with a driver to edit</param>
        private void EditDriver_Internal(List <RigidNode_Base> nodes)
        {
            if (nodes == null || nodes.Count == 0)
            {
                return;
            }

            currentlyEditing = true;

            AnalyticsUtils.LogPage("Advanced Joint Editor", "Driver Editor");
            jointDriverEditorFormDialog.ShowDialog(nodes[0].GetSkeletalJoint(), nodes, ParentForm);

            if (ModifiedJoint != null && jointDriverEditorFormDialog.Saved)
            {
                ModifiedJoint(nodes);
            }
            UpdateJointList();
            currentlyEditing = false;
        }
コード例 #21
0
 private void AddPlayerActionsPerMinuteRank()
 {
     AnalyticsUtils.AddCategorizedEventParam(
         "Player.ActionsPerMinuteRank", player.ActionsPerMinuteRank);
 }
コード例 #22
0
 private void AddPlayerDeaths()
 {
     AnalyticsUtils.AddEventParam("Player.Deaths", player.DeathsCount);
 }
コード例 #23
0
        /// <summary>
        /// Create a new JointEditorPane and register actions for the right click menu
        /// </summary>
        public AdvancedJointEditorUserControl()
        {
            InitializeComponent();
            this.DoLayout(null, null);

            RegisterContextAction("Edit Driver", EditDriver_Internal);
            RegisterContextAction("Edit Sensors", ListSensors_Internal);
            RegisterContextAction("Edit Limits", (List <RigidNode_Base> nodes) =>
            {
                try    // prevent the user from just left clicking on the black joint pane and trying to edit nothing
                {
                    if (nodes.Count != 1)
                    {
                        return;
                    }

                    var node = nodes[0];
                    if (node != null && node.GetSkeletalJoint() != null)    // prevents the user from trying to edit a null joint
                    {
                        AnalyticsUtils.LogPage("Advanced Joint Editor", "Limit Editor");
                        var limitEditor = new JointLimitEditorForm(node.GetSkeletalJoint());    // show the limit editor form
                        limitEditor.ShowDialog(ParentForm);
                    }
                }
                catch (NullReferenceException)    //catch when the user clicks on the pane without a node selected
                {
                    MessageBox.Show("Please select a node!");
                }
            });

            lstJoints.Activation    = ItemActivation.Standard;
            lstJoints.ItemActivate += (object sender, EventArgs e) =>
            {
                EditDriver_Internal(GetSelectedNodes());
            };

            selectionFinishedTimeout.Tick    += FinishedSelecting;
            selectionFinishedTimeout.Interval = 55; // minimum accuracy of winforms timers

            SelectedJoint += nodes => InventorUtils.FocusAndHighlightNodes(nodes, RobotExporterAddInServer.Instance.Application.ActiveView.Camera, 1);
            ModifiedJoint += delegate(List <RigidNode_Base> nodes)
            {
                if (nodes == null || nodes.Count == 0)
                {
                    return;
                }

                foreach (var node in nodes)
                {
                    if (node.GetSkeletalJoint() != null && node.GetSkeletalJoint().cDriver != null &&
                        node.GetSkeletalJoint().cDriver.GetInfo <WheelDriverMeta>() != null &&
                        node.GetSkeletalJoint().cDriver.GetInfo <WheelDriverMeta>().radius == 0 &&
                        node is OGL_RigidNode)
                    {
                        (node as OGL_RigidNode).GetWheelInfo(out var radius, out var width, out var center);

                        var wheelDriver = node.GetSkeletalJoint().cDriver.GetInfo <WheelDriverMeta>();
                        wheelDriver.center = center;
                        wheelDriver.radius = radius;
                        wheelDriver.width  = width;
                        node.GetSkeletalJoint().cDriver.AddInfo(wheelDriver);
                    }
                }
            };
        }
コード例 #24
0
        private void InitEnvironmentPanels(RibbonTab exporterTab, string clientId, ControlDefinitions controlDefs)
        {
            // DRIVETRAIN PANEL
            driveTrainPanel = exporterTab.RibbonPanels.Add("Drive Train Setup", "BxD:RobotExporter:DriveTrainPanel", clientId);

            driveTrainTypeButton = controlDefs.AddButtonDefinition("Drive Train\nLayout",
                                                                   "BxD:RobotExporter:SetDriveTrainType", CommandTypesEnum.kNonShapeEditCmdType, clientId, null,
                                                                   "Select the drivetrain type (tank, H-drive, or mecanum).", ToIPictureDisp(new Bitmap(Resources.DrivetrainType32)), ToIPictureDisp(new Bitmap(Resources.DrivetrainType32)));
            driveTrainTypeButton.OnExecute += context =>
            {
                AnalyticsUtils.LogPage("Drivetrain Type Editor");
                new DrivetrainLayoutForm(RobotDataManager).ShowDialog();
            };
            driveTrainPanel.CommandControls.AddButton(driveTrainTypeButton, true);

            drivetrainWeightButton = controlDefs.AddButtonDefinition("Drive Train\nWeight",
                                                                     "BxD:RobotExporter:SetDriveTrainWeight", CommandTypesEnum.kNonShapeEditCmdType, clientId, null,
                                                                     "Assign the weight of the drivetrain.", ToIPictureDisp(new Bitmap(Resources.RobotWeight32)), ToIPictureDisp(new Bitmap(Resources.RobotWeight32)));
            drivetrainWeightButton.OnExecute += context =>
            {
                AnalyticsUtils.LogPage("Drivetrain Weight Editor");
                RobotDataManager.PromptRobotWeight();
            };
            driveTrainPanel.CommandControls.AddButton(drivetrainWeightButton, true);

            // JOINT PANEL
            jointPanel = exporterTab.RibbonPanels.Add("Joint Setup", "BxD:RobotExporter:JointPanel", clientId);

            advancedEditJointButton = controlDefs.AddButtonDefinition("Advanced Editor", "BxD:RobotExporter:AdvancedEditJoint",
                                                                      CommandTypesEnum.kNonShapeEditCmdType, clientId, null, "Joint editor for advanced users.", ToIPictureDisp(new Bitmap(Resources.JointEditor32)), ToIPictureDisp(new Bitmap(Resources.JointEditor32)));
            advancedEditJointButton.OnExecute += context =>
            {
                if (advancedJointEditor.Visible)
                {
                    return;
                }
                AnalyticsUtils.LogPage("Advanced Joint Editor");
                advancedJointEditor.Visible = true;
                jointEditorForm.Visible     = false;
            };
            jointPanel.SlideoutControls.AddButton(advancedEditJointButton);

            editJointButton = controlDefs.AddButtonDefinition("Edit Joints", "BxD:RobotExporter:EditJoint",
                                                              CommandTypesEnum.kNonShapeEditCmdType, clientId, null, "Edit existing joints.", ToIPictureDisp(new Bitmap(Resources.JointEditor32)), ToIPictureDisp(new Bitmap(Resources.JointEditor32)));
            editJointButton.OnExecute += context =>
            {
                if (!jointEditorForm.HasJoints())
                {
                    var result = MessageBox.Show("No rotational or slider joints detected in the assembly! Add joints to your robot by using the \"Joint\" button under \"Assemble\" and restart the robot export environment to edit joints.\n\n" +
                                                 "Would you like to view a video tutorial on adding joints to your assembly?", "No Joints Found", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                    if (result.Equals(DialogResult.Yes))
                    {
                        System.Diagnostics.Process.Start("https://youtu.be/fY3Vdkh8L0Y");
                    }
                    return;
                }

                if (jointEditorForm.Visible)
                {
                    jointEditorForm.Activate();
                }
                else
                {
                    AnalyticsUtils.LogPage("Joint Editor");
                    UnsupportedComponentsForm.CheckUnsupportedComponents(RobotDataManager.RobotBaseNode.ListAllNodes());
                    jointEditorForm.PreShow();
                    jointEditorForm.Show();
                    advancedJointEditor.Visible = false;
                }
            };
            jointPanel.CommandControls.AddButton(editJointButton, true);

            // PRECHECK PANEL
            precheckPanel = exporterTab.RibbonPanels.Add("Export Precheck", "BxD:RobotExporter:ChecklistPanel", clientId);

            dofButton = controlDefs.AddButtonDefinition("Toggle Joint\nViewer", "BxD:RobotExporter:JointViewer",
                                                        CommandTypesEnum.kNonShapeEditCmdType, clientId, null, "View status of all joints.", ToIPictureDisp(new Bitmap(Resources.Guide32)), ToIPictureDisp(new Bitmap(Resources.Guide32)));
            dofButton.OnExecute += context =>
            {
                jointViewKey.Visible = !jointViewKey.Visible;
                HighlightManager.DisplayJointHighlight = jointViewKey.Visible;
                if (jointViewKey.Visible)
                {
                    AnalyticsUtils.LogPage("Joint View");
                }
            };
            precheckPanel.CommandControls.AddButton(dofButton, true);

            // ADD-IN SETTINGS PANEL
            addInSettingsPanel = exporterTab.RibbonPanels.Add("Add-In", "BxD:RobotExporter:AddInSettings", clientId);

            settingsButton = controlDefs.AddButtonDefinition("Add-In Settings", "BxD:RobotExporter:Settings",
                                                             CommandTypesEnum.kNonShapeEditCmdType, clientId, null, "Configure add-in settings.", ToIPictureDisp(new Bitmap(Resources.Gears16)), ToIPictureDisp(new Bitmap(Resources.Gears32)));
            settingsButton.OnExecute += context =>
            {
                AnalyticsUtils.LogPage("Exporter Settings");
                new ExporterSettingsForm().ShowDialog();
            };
            addInSettingsPanel.CommandControls.AddButton(settingsButton, true);
        }
コード例 #25
0
 private void Open()
 {
     this.currentGUID = AnalyticsUtils.GenerateGUID();
     base.StartCoroutine(this.Slide());
     AnalyticsManager.FairyShown(this.currentGUID, AdsManager.Instance.RewardConfig.timingBonus);
 }
コード例 #26
0
        /// <inheritdoc />
        void RecordPurchase(string id, double price, double amountPurchased, string currency = null, string store = null, string transactionId = null)
        {
            try
            {
                //Every event has an embedded properties structure
                //First we will build the Properties structure
                //Then we will build the encapsulating event structure
                TrackPropertyBuilder propertyBuilder = new TrackPropertyBuilder();
                propertyBuilder.SetCategory("revenue");

                Dictionary <string, object> recordPurchaseProperties = propertyBuilder.Build();

                recordPurchaseProperties.Add("productId", id);
                recordPurchaseProperties.Add("price", price);
                recordPurchaseProperties.Add("quantity", 1);
                if (store != null)
                {
                    recordPurchaseProperties.Add("revenueType", store);
                }
                if (transactionId != null)
                {
                    recordPurchaseProperties.Add("transactionId", transactionId);
                }

                //Add the FoolProofParams
                Dictionary <string, object> eventData = AnalyticsUtils.FoolProofParams(GetCommonEventData());
                foreach (var key in eventData.Keys)
                {
                    var value = eventData[key];
                    if (value != null)
                    {
                        recordPurchaseProperties.Add(key, value);
                    }
                }

                //Now build the event structure
                RudderElementBuilder elementBuilder = new RudderElementBuilder();
                elementBuilder.WithEventName("revenue");

                //Set user id if available
                if (WynnEngine.PlayerId.HasValue())
                {
                    elementBuilder.WithUserId(WynnEngine.PlayerId);
                }

                //Add the properties structure created to the event
                elementBuilder.WithEventProperties(recordPurchaseProperties);

                // Create the event object
                RudderElement element = elementBuilder.Build();

                // Set the integrations
                element.integrations = new Dictionary <string, object>();
                element.integrations.Add("All", true);

                //Invoke track method
                rudder.Track(element);

                // GameEngine.LogError("RudderAnalyticsManager: Track: revenue");
            }
            catch (Exception e)
            {
                GameEngine.LogError("RudderAnalyticsManager: Track: Error: " + e.Message);
            }
        }