示例#1
0
    /* Public interface for use inside C# / JS code */

    public static void Init(string appId, string secretId, SuccessDelegate successMethod, FailedDelegate failedMethod)
    {
        // Call plugin only when running on real device
        if (Application.platform != RuntimePlatform.OSXEditor && Application.platform != RuntimePlatform.WindowsEditor)
        {
            if (_tdEAuth == null)
            {
                _tdEAuth = GameObject.FindObjectOfType <TalkingDataEAuth>();
                if (_tdEAuth == null)
                {
                    _tdEAuth = new GameObject("TalkingDataEAuth").AddComponent <TalkingDataEAuth>();
                }
            }
            _tdEAuth._successDelegate = successMethod;
            _tdEAuth._failedDelegate  = failedMethod;
#if UNITY_IPHONE
            tdEAuthInit(appId, secretId);
#endif
#if UNITY_ANDROID
            AndroidJavaClass  unityClass   = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            AndroidJavaObject currActivity = unityClass.GetStatic <AndroidJavaObject>("currentActivity");
            AndroidJavaClass  tdEAuthClass = new AndroidJavaClass("com.tendcloud.tenddata.unityplugin.TalkingDataEAuthPlugin");
            Debug.Log("android eAuth start");
            tdEAuthClass.CallStatic("init", currActivity, appId, secretId);
#endif
        }
    }
示例#2
0
        /// <summary> Initializes a new instance of the <see cref="GeocoderBase"/> class. Adds a new layer which can
        /// later contain the geocoding results to the map. </summary>
        /// <param name="errorDelegate"> The delegate method to call in case of an error. </param>
        /// <param name="successDelegate"> The delegate method to call to propagate results. </param>
        /// <param name="map"> The map where the result layer is added to. </param>
        public GeocoderBase(ErrorDelegate errorDelegate, SuccessDelegate successDelegate, IMap map)
        {
            this.errorDelegate   = errorDelegate;
            this.successDelegate = successDelegate;
            PinColor             = Colors.Blue;

            #region doc:add result layer
            ContentLayer = new ShapeLayer("Addresses")
            {
                SpatialReferenceId = "PTV_MERCATOR"
            };
            map.Layers.Add(ContentLayer);
            #endregion
        }
示例#3
0
    static void ProcessSampler(string exportPath, StringBuilder builder, Material mat, string unityName, string vlName, SuccessDelegate successCallback = null)
    {
        if (!mat.HasProperty(unityName))
        {
            return;
        }

        Texture tex = mat.GetTexture(unityName);

        if (tex != null)
        {
            string texPath = AssetDatabase.GetAssetOrScenePath(tex);
            string outPath = exportPath + Path.GetFileName(texPath);

            // Doctor out path to ensure that normal maps are handled correctly
            if (vlName == "normalMap" || vlName == "detailNormalMap")
            {
                if (!outPath.Contains("normal"))
                {
                    string ext = Path.GetExtension(outPath);
                    outPath = outPath.Substring(0, outPath.Length - ext.Length) + "_normal" + ext;
                }
            }

            //Copy texture to export path
            File.Copy(texPath, outPath, true);

            builder.Append("sampler\n{\n");
            builder.Append(string.Format("   name: \"{0}\"\n", vlName));
            builder.Append(string.Format("   map: \"{0}\"\n", Regex.Replace(outPath, ".*?/content/", string.Empty)));
            builder.Append("}\n\n");

            if (successCallback != null)
            {
                successCallback();
            }
        }
    }
 /// <summary> Initializes a new instance of the <see cref="SingleFieldGeocoder"/> class. Adds a new layer which
 /// can later contain the geocoding results to the map. </summary>
 /// <param name="errDlg"> The delegate method to call in case of an error. </param>
 /// <param name="succDlg"> The delegate method to call to propagate results. </param>
 /// <param name="wpfMap"> The map where the result layer is added to. </param>
 public SingleFieldGeocoder(ErrorDelegate errDlg, SuccessDelegate succDlg, WpfMap wpfMap)
     : base(errDlg, succDlg, wpfMap)
 {
 }