예제 #1
0
        public WCFService(SipServerConfigurationSection configuration, EnhancedPresence1 enhancedPresence, TrunkManager trunkManager, Accountx accounts, IUserz userz)
        {
            this.accounts = accounts;

            this.userz          = userz;
            this.userz.Reset   += IUsers_Reloaded;
            this.userz.Added   += IUsers_Added;
            this.userz.Updated += IUsers_Updated;
            this.userz.Removed += IUsers_Removed;

            this.enhancedPresence = enhancedPresence;
            this.enhancedPresence.AvailabilityChanged += AvailabilityChanged;

            this.trunkManager = trunkManager;
            this.trunkManager.TrunkUpdated += TrunkUpdated;

            this.serviceAddress = configuration.WcfServiceAddress;
            //this.domainName = configuration.DomainName;
            this.validator = new CustomUserNamePasswordValidator(@"administrator", configuration.AdministratorPassword);
        }
예제 #2
0
파일: Level.cs 프로젝트: robinxb/Test
    public void GenerateLevel()
    {
        if (trunksParent) {
            Object.Destroy(trunksParent);
            trunksParent = null;
        }

        trunksParent = new GameObject ();
        trunksParent.name = string.Format (parentNameFormatter, levelIdx);

        rmg = new RoomGenerator ();
        rmg.GenerateRoom ();
        rmg.FillTilemap ();
        rmg.GenerateNeighborMap ();

        RoomGenerator.TileType[,] tiles = rmg.TileMapData;

        TrunkManager tm = new TrunkManager (rmg.mapWidth);
        tm.FillWithData (rmg.NeighborMapData, tiles);

        TextureConfig.TextureData td = TextureConfig.BackgroundTextures[levelIdx];

        for (int i = 0; i < TrunkManager.MaxTrunks; i ++) {
            if (tm[i] == null) continue;
            GameObject t = new GameObject((string.Format(trunkNameFormatter, i)) ,typeof(MeshRenderer), typeof(MeshFilter));
            Trunk trunk = tm[i];
            t.GetComponent<MeshFilter>().mesh = trunk.mesh;
            Vector3 pos = t.transform.position;
            pos.x = trunk.x;
            pos.y = trunk.y;
            t.transform.position = pos;
            t.transform.SetParent(trunksParent.transform);
            MeshRenderer mr = t.GetComponent<MeshRenderer>();
            Material mtl = Resources.Load(td.path) as Material;
            mr.sharedMaterial = mtl;
        }
    }