コード例 #1
0
    private void onTouch(GameObject go)
    {
        if (this.children == null || this.children.Length <= 1)
        {
            return;
        }
        int length = this.children.Length;
        int i      = 0;

        while (i < length)
        {
            if (this.children[i].name == go.name)
            {
                if (i == this.currentIndex)
                {
                    return;
                }
                this.Active(i);
                DelegateProxy.PlayUIAudio(15);
                if (this.touchEvent != null)
                {
                    this.touchEvent(i, this.children[i]);
                }
                break;
            }
            else
            {
                i++;
            }
        }
    }
コード例 #2
0
    private void CreateMouseObj()
    {
        string strFileName = "Prefabs/UI/MousePanel";

        //string strFile = strFileName.ToLower();
        DelegateProxy.LoadAsset(strFileName, OnPrefabLoaded);
    }
コード例 #3
0
 public static void OnShareCallback(string result)
 {
     if (DelegateProxy.OnShareCallbackProxy != null)
     {
         DelegateProxy.OnShareCallbackProxy(result);
     }
 }
コード例 #4
0
 private void OnValidateLoadComplete(params object[] args)
 {
     if (this.mGo == null)
     {
         return;
     }
     this.mPrefab = (args[0] as UnityEngine.Object);
     if (this.mPrefab != null)
     {
         GameObject gameObject = DelegateProxy.Instantiate(this.mPrefab, Vector3.zero, Quaternion.identity) as GameObject;
         if (gameObject != null)
         {
             gameObject.transform.parent        = base.transform;
             gameObject.transform.localPosition = this.mvecPos;
             gameObject.transform.localRotation = Quaternion.Euler(this.mvecRot);
             gameObject.transform.localScale    = this.mvecScale;
             this.mGoEffect = gameObject;
             NGUITools.SetLayer(this.mGoEffect, this.mGo.layer);
             this.mGoEffect.SetActive(this.mbCurActive);
             this.mbValidate = false;
         }
     }
     if (this.LoadModelComplete != null)
     {
         this.LoadModelComplete(this.mGoEffect);
     }
     if (this.gameObjectActiveCallBack != null)
     {
         this.gameObjectActiveCallBack();
     }
 }
コード例 #5
0
 public static void GameDestory(UnityEngine.Object obj)
 {
     if (DelegateProxy.GameDestoryProxy != null)
     {
         DelegateProxy.GameDestoryProxy(obj);
     }
 }
コード例 #6
0
 public static void OnSendMessageCallback(int iMSG, params object[] objects)
 {
     if (DelegateProxy.onSendMessageCallbackDelegateProxy != null)
     {
         DelegateProxy.onSendMessageCallbackDelegateProxy(iMSG, objects);
     }
 }
コード例 #7
0
        /// <summary>
        /// Registers a object as CoreRemoting service.
        /// </summary>
        /// <param name="serviceInstance">Object instance that should be registered as service</param>
        /// <param name="serviceName">Unique service name (Interface full type name is used, if left blank)</param>
        /// <param name="interfaceType">Service interface type</param>
        /// <param name="uniqueServerInstanceName">Unique server instance name</param>
        /// <returns>Service name</returns>
        public static string Marshal(
            object serviceInstance,
            string serviceName,
            Type interfaceType,
            string uniqueServerInstanceName = "")
        {
            var server =
                string.IsNullOrWhiteSpace(uniqueServerInstanceName)
                    ? RemotingServer.DefaultRemotingServer
                    : RemotingConfiguration.GetRegisteredServer(uniqueServerInstanceName);

            var container = server.ServiceRegistry;

            var registerServiceMethod =
                container.GetRegisterServiceMethodForServiceInstance(interfaceType, serviceInstance);

            if (string.IsNullOrWhiteSpace(serviceName))
            {
                serviceName = interfaceType.FullName;
            }

            var genericFunc      = typeof(Func <>);
            var factoryFunc      = genericFunc.MakeGenericType(interfaceType);
            var factoryFuncProxy =
                new DelegateProxy(factoryFunc, delegateArgs => serviceInstance);

            registerServiceMethod.Invoke(container, new object[]
            {
                factoryFuncProxy.ProxiedDelegate,
                ServiceLifetime.Singleton,
                serviceName
            });

            return(serviceName);
        }
コード例 #8
0
 public static void OnSetPayCallback(List <IAPProductInfo> productInfos)
 {
     if (DelegateProxy.OnSetPayCallbackProxy != null)
     {
         DelegateProxy.OnSetPayCallbackProxy(productInfos);
     }
 }
コード例 #9
0
 public static void PlayUIAudio(int index)
 {
     if (DelegateProxy.PlayUIAudioProxy != null)
     {
         DelegateProxy.PlayUIAudioProxy(index);
     }
 }
コード例 #10
0
 public static void GetGuiCompent(Dictionary <int, GameObject> lastgameObject, ref List <Component> newPanels, ref List <Component> tempPanels)
 {
     if (DelegateProxy.GetGuiCompentProxy != null)
     {
         DelegateProxy.GetGuiCompentProxy(lastgameObject, ref newPanels, ref tempPanels);
     }
 }
コード例 #11
0
 public static void DestroyEffect(GameObject obj, int layer)
 {
     if (DelegateProxy.DestroyEffectProxy != null)
     {
         DelegateProxy.DestroyEffectProxy(obj, layer);
     }
 }
コード例 #12
0
 public static void HideView(string name)
 {
     if (DelegateProxy.HideViewProxy != null)
     {
         DelegateProxy.HideViewProxy(name);
     }
 }
コード例 #13
0
 public static void LoadAsset(string strFileName, AssetCallBack callback)
 {
     if (DelegateProxy.LoadAssetProxy != null)
     {
         DelegateProxy.LoadAssetProxy(strFileName, callback);
     }
 }
コード例 #14
0
 public static void UnloadAsset(object[] args)
 {
     if (DelegateProxy.UnloadAssetProxy != null)
     {
         DelegateProxy.UnloadAssetProxy(args);
     }
 }
コード例 #15
0
 public static void DestroyView(string name)
 {
     if (DelegateProxy.DestroyViewProxy != null)
     {
         DelegateProxy.DestroyViewProxy(name);
     }
 }
コード例 #16
0
 public static void ShowView(string name, object arg = null)
 {
     if (DelegateProxy.ShowViewProxy != null)
     {
         DelegateProxy.ShowViewProxy(name, arg);
     }
 }
コード例 #17
0
 public static void GamePoolDestory(GameObject obj)
 {
     if (DelegateProxy.GameDestoryPoolProxy != null)
     {
         DelegateProxy.GameDestoryPoolProxy(obj);
     }
 }
コード例 #18
0
 public static void PopCache(UnityEngine.Object o)
 {
     if (DelegateProxy.PopCacheProxy != null)
     {
         DelegateProxy.PopCacheProxy(o);
     }
 }
コード例 #19
0
 public static void OnVerifyTransCallback(string pid, int amount, string transactionData, string transactionIdentifier, string account, string rolename, string serverid, string accountid)
 {
     if (DelegateProxy.OnVerifyTransCallbackProxy != null)
     {
         DelegateProxy.OnVerifyTransCallbackProxy(pid, amount, transactionData, transactionIdentifier, account, rolename, serverid, accountid);
     }
 }
コード例 #20
0
 public void ClearAnimationClips()
 {
     if (this.mAnimation == null || this.mActionControlList.Count == 0)
     {
         return;
     }
     for (int i = 0; i < this.mActionControlList.Count; i++)
     {
         string key = this.mActionControlList[i];
         if (this.mActionLoadedDict.ContainsKey(key))
         {
             AnimationClip animationClip = this.mActionLoadedDict[key];
             if (animationClip != null)
             {
                 this.mAnimation.RemoveClip(animationClip);
             }
             this.mActionLoadedDict.Remove(key);
             DelegateProxy.PopCache(animationClip);
         }
     }
     if (this.mAnimation.clip != null && !this.mActionControlList.Contains(this.mAnimation.clip.name))
     {
         this.mAnimation.RemoveClip(this.mAnimation.clip);
         DelegateProxy.PopCache(this.mAnimation.clip);
         this.mAnimation.clip = null;
     }
 }
コード例 #21
0
 private void OnDisable()
 {
     if (this.m_Material)
     {
         DelegateProxy.DestroyObjectImmediate(this.m_Material);
     }
 }
コード例 #22
0
 private void OnClickEvent(GameObject go)
 {
     DelegateProxy.OnSendMessageCallback(this.messageID, new object[]
     {
         this.subMessagetID
     });
 }
コード例 #23
0
 protected virtual void OnDisable()
 {
     if (this.mMaterial)
     {
         DelegateProxy.DestroyObjectImmediate(this.mMaterial);
     }
 }
コード例 #24
0
    /// <summary>
    /// 清除所有动作引用
    /// </summary>
    public void ClearAnimationClips()
    {
        if (mAnimation == null || mActionControlList.Count == 0)
        {
            return;
        }

        ///清除所有一次性动作
        for (int i = 0; i < mActionControlList.Count; i++)
        {
            string strActionName = mActionControlList[i];
            if (mActionLoadedDict.ContainsKey(strActionName))
            {
                AnimationClip aClip = mActionLoadedDict[strActionName];
                mAnimation.RemoveClip(aClip);
                mActionLoadedDict.Remove(strActionName);
                DelegateProxy.PopCache(aClip);
            }
        }

        ///清除主动作
        if (mAnimation.clip != null)
        {
            mAnimation.RemoveClip(mAnimation.clip);
            DelegateProxy.PopCache(mAnimation.clip);
            mAnimation.clip = null;
        }
    }
コード例 #25
0
    /// <summary>
    /// 根据当前场景的地图信息,计算生成地形网格顶点列表
    /// </summary>
    public void BuildGeometry()
    {
        if (this.mesh == null)
        {
            this.mesh = new Mesh();
        }
        int segmentsW = this.terrainData.segmentsW;
        int segmentsH = this.terrainData.segmentsH;
        int num       = segmentsW + 1;
        int num2      = (segmentsH + 1) * num;

        this.vertices = new Vector3[num2];
        num2          = 0;
        for (int i = 0; i <= segmentsH; i++)
        {
            for (int j = 0; j <= segmentsW; j++)
            {
                float num3   = ((float)j / (float)segmentsW - 0.5f) * this.terrainData.size.x;
                float num4   = ((float)i / (float)segmentsH - 0.5f) * this.terrainData.size.z;
                float height = GameScene.mainScene.terrainData.GetHeight(Mathf.FloorToInt(num3 + base.transform.position.x + 240f), Mathf.FloorToInt(num4 + base.transform.position.z + 240f));
                this.vertices[num2] = new Vector3(num3, height, num4);
                num2++;
            }
        }
        this.mesh.vertices = this.vertices;
        if (Application.isEditor && base.gameObject != null)         //如果是编辑器环境,销毁重建网格碰撞器
        {
            MeshCollider component = base.gameObject.GetComponent <MeshCollider>();
            if (component != null)
            {
                DelegateProxy.DestroyObjectImmediate(component);
                base.gameObject.AddComponent <MeshCollider>();
            }
        }
    }
コード例 #26
0
    private void CreateMouseObj()
    {
        string text  = "Prefabs/UI/MousePanel";
        string text2 = text.ToLower();

        DelegateProxy.LoadAsset(text, new AssetCallBack(this.OnPrefabLoaded));
    }
コード例 #27
0
 /// <summary>
 /// 设置不可视 ,开始隐藏
 /// </summary>
 public void Invisible()
 {
     if (this.visible)
     {
         if (this.bornEffect != null)
         {
             DelegateProxy.GameDestory(this.bornEffect);
         }
         if (this.isStatic)
         {
             if (this.ins != null)
             {
                 this.ins.SetActive(false);
             }
         }
         else if (this.ins != null)
         {
             this.ins.SetActive(false);
             if (this.activeListener != null)
             {
                 this.activeListener(false);
             }
         }
     }
     this.visible = false;
 }
コード例 #28
0
 public void DestroyAll()
 {
     foreach (KeyValuePair <string, SpawnPool> current in this._pools)
     {
         DelegateProxy.GameDestory(current.Value);
     }
 }
コード例 #29
0
 public static UnityEngine.Object Instantiate(UnityEngine.Object o)
 {
     if (DelegateProxy.mDelegateInstantiateNoParam != null)
     {
         return(DelegateProxy.mDelegateInstantiateNoParam(o));
     }
     return(UnityEngine.Object.Instantiate(o));
 }
コード例 #30
0
 public static string StringBuilder(params object[] args)
 {
     if (DelegateProxy.StringBuilderPorxy != null)
     {
         return(DelegateProxy.StringBuilderPorxy(args));
     }
     return(string.Empty);
 }