Пример #1
0
        public XmlNode ToXmlNodeForUserData()
        {
            XmlNode layerNode = CreateXmlNode("layer");

            XmlAttribute attribute = CreateXmlAttributeOfFile("name");

            attribute.Value = Name;
            layerNode.Attributes.Append(attribute);

            XmlAttribute triggerAttribute = CreateXmlAttributeOfFile("trigger");

            if (TriggerAction == "Click")
            {
                triggerAttribute.Value = "OneClick";
            }
            else if (TriggerAction == "Double_Click")
            {
                triggerAttribute.Value = "DoubleClick";
            }
            else
            {
                triggerAttribute.Value = TriggerAction;
            }
            layerNode.Attributes.Append(triggerAttribute);

            XmlAttribute attributeEye = CreateXmlAttributeOfFile("Eye");

            attributeEye.Value = Eye.ToString();
            layerNode.Attributes.Append(attributeEye);

            // devices
            XmlNode            devicesNode  = CreateXmlNode("devices");
            List <DeviceModel> deviceModels = SpacePage.Self.DeviceModelCollection;

            foreach (var d in deviceModels)
            {
                XmlNode deviceNode = GetDeviceUsageXmlNode(d);
                devicesNode.AppendChild(deviceNode);
            }
            layerNode.AppendChild(devicesNode);

            // effects
            XmlNode       effectsNode = CreateXmlNode("effects");
            List <Effect> effects     = new List <Effect>();

            foreach (var vm in EffectLineViewModels)
            {
                effects.Add(vm.Model);
            }
            effects.AddRange(TriggerEffects);
            foreach (var eff in effects)
            {
                XmlNode effNode = eff.ToXmlNodeForUserData();
                effectsNode.AppendChild(effNode);
            }
            layerNode.AppendChild(effectsNode);

            return(layerNode);
        }
Пример #2
0
        public override string ToString()
        {
            string resultStr = Eye.ToString();

            resultStr += ",";
            resultStr += Center.ToString();
            resultStr += ",";
            resultStr += Up.ToString();
            return(resultStr);
        }
Пример #3
0
        public void Render(Device device, DeviceInfo deviceInfo)
        {
            if (DoRender)
            {
                string msg = "Eye: " + Eye.ToString() +
                             "\nLookAt: " + LookAt.ToString() +
                             "\nLook: " + Look.ToString() +
                             "\nlook: " + look.ToString() +
                             "\nStraightOn: " + StraightOn.ToString() +
                             "\nRight: " + Right.ToString() +
                             "\nUp: " + Up.ToString();

                infoD3DFont.DrawText(
                    null,                                                                                                    // Paramètre avancé
                    msg,                                                                                                     // Texte à afficher
                    new Rectangle(device.Viewport.X, device.Viewport.Y + 30, device.Viewport.Width, device.Viewport.Height), // Découpe ce texte dans ce rectangle
                    DrawTextFormat.Left |                                                                                    // Aligne le texte à la gauche de la fenêtre
                    DrawTextFormat.Top |                                                                                     // et à son dessus
                    DrawTextFormat.WordBreak,                                                                                // Et saute des lignes si necessaire
                    Color.Maroon);                                                                                           // En quelle couleur dessiner le texte
            }
        }
Пример #4
0
    void OnPostRender()
    {
        //DrawVignetteLine();
        screenFade();
        int eyeTextureId = Pvr_UnitySDKManager.SDK.eyeTextureIds[IDIndex];

        // SaveImage(Pvr_UnitySDKManager.SDK.eyeTextures[IDIndex], eye.ToString());
        Pvr_UnitySDKPluginEvent.IssueWithData(eventType, eyeTextureId);
        if (Input.GetKeyDown(KeyCode.JoystickButton0))
        {
            cube.transform.Rotate(0, 0, 360 * Time.deltaTime);
            SaveImages.SaveImage(Pvr_UnitySDKManager.SDK.eyeTextures[Pvr_UnitySDKManager.SDK.currEyeTextureIdx + (int)eye * 3], eye.ToString());
        }
#if !UNITY_EDITOR && UNITY_ANDROID
        if (eye == Eye.LeftEye && !setLevel && Pvr_UnitySDKManager.SDK.IsViewerLogicFlow)
        {
            AndroidJavaClass AvrAPI = new UnityEngine.AndroidJavaClass("com.unity3d.player.AvrAPI");
            Pvr_UnitySDKAPI.System.UPvr_CallStaticMethod(AvrAPI, "setVrThread");
            setLevel = true;
            Debug.Log("Viewer setVrThread");
        }
        else
        {
            return;
        }
#endif
    }
Пример #5
0
 public override string ToString()
 {
     return("Head: " + GetType() + ": " + Serial + "\nLeft Eye: " + LeftEye.ToString() + "\nRight Eye: " + RightEye.ToString());
 }