コード例 #1
0
            public void spawn(FactionCountry factionCountry, PlayerClass playerClass)
            {
                int currentRoundIdentifier = instant.serverGameManager.CurrentRoundIdentifier;
                SpawnSectionCriteria spawnSectionCriteria = ComponentReferenceManager.genericObjectPools.spawnSectionCriteria.Obtain();

                spawnSectionCriteria.Faction = factionCountry;
                dfList <SpawnSection> dfList = instant.serverSpawnSectionManager.QuerySpawnSections(spawnSectionCriteria, false);

                ComponentReferenceManager.genericObjectPools.spawnSectionCriteria.Release(spawnSectionCriteria);
                if (dfList.Count == 0)
                {
                    dfList.Release();
                    return;
                }
                int sectionIdentifier = dfList[0].sectionIdentifier;

                dfList.Release();
                int characterHeadIdentifier = 1;
                CharacterVoiceIdentifier  characterVoiceIdentifier = getDefaultVoice(factionCountry);
                ClientChosenSpawnSettings spawnSettings            = new ClientChosenSpawnSettings
                {
                    RoundIdentifier          = currentRoundIdentifier,
                    CharacterVoiceIdentifier = characterVoiceIdentifier,
                    CharacterHeadIdentifier  = characterHeadIdentifier,
                    Faction        = factionCountry,
                    ClassType      = playerClass,
                    SpawnSectionID = sectionIdentifier
                };

                instant.serverGameManager.QueueClientChosenSpawnSettings(networkPlayer, spawnSettings, false);
            }
コード例 #2
0
        public override void Release()
        {
            if (!inUse)
            {
                return;
            }

            inUse = false;

            this.Reset();

            if (this.tokens != null)
            {
                this.tokens.Release();
                this.tokens = null;
            }

            if (lines != null)
            {
                lines.ReleaseItems();
                lines.Release();
                lines = null;
            }

            this.BottomColor = (Color32?)null;

            objectPool.Enqueue(this);
        }
コード例 #3
0
ファイル: dfDynamicFont.cs プロジェクト: Elringus/HajiJam
        public override void Release()
        {
            this.Reset();

            this.tokens = null;

            if (lines != null)
            {
                lines.Release();
                lines = null;
            }

            LineRenderInfo.ResetPool();

            this.BottomColor = (Color32?)null;

            objectPool.Enqueue(this);
        }
コード例 #4
0
    private void releaseMarkupReferences()
    {
        this.mouseDownTag = null;

        if (viewportBox != null)
        {
            viewportBox.Release();
        }

        if (elements != null)
        {
            for (int i = 0; i < elements.Count; i++)
            {
                elements[i].Release();
            }

            elements.Release();
        }
    }