コード例 #1
0
        public IMediator getMediator(string mediatorName)
        {
            IMediator mediator;

            if (mediatorMap.TryGetValue(mediatorName, out mediator))
            {
                return(mediator);
            }
            return(null);
        }
コード例 #2
0
ファイル: Hypertext.cs プロジェクト: ly774508966/foundation
        public void load(string spriteName)
        {
            if (anim != null)
            {
                anim.stop();
            }

            string path;

            if (upkList.TryGetValue(spriteName, out path))
            {
                if (anim == null)
                {
                    anim = gameObject.AddComponent <ImageAnimation>();
                }
                anim.load(path);
                anim.play(true);
                return;
            }

            Sprite sprite;

            if (spriteList.TryGetValue(spriteName, out sprite))
            {
                image.sprite = sprite;
                return;
            }

            image.sprite = Resources.Load <Sprite>(spriteName);
        }
コード例 #3
0
        public IProxy getProxy(string proxyName)
        {
            IProxy proxy;

            if (proxyMap.TryGetValue(proxyName, out proxy))
            {
                return(proxy);
            }
            return(null);
        }
コード例 #4
0
        public object getInjectLock(string className)
        {
            object value;

            if (mvcInjectProxyLock.TryGetValue(className, out value))
            {
                return(value);
            }
            if (mvcInjectMediatorLock.TryGetValue(className, out value))
            {
                return(value);
            }
            return(null);
        }
コード例 #5
0
        public static Texture GetSharedColorTexture(Color color)
        {
            Texture result;

            if (texture2Dictionary.TryGetValue(color, out result) == false || result == null)
            {
                Texture2D texture2D = new Texture2D(1, 1);
                texture2D.SetPixel(1, 1, color);
                texture2D.Apply();

                result = texture2D;
                texture2Dictionary[color] = result;
            }

            return(result);
        }