Common.Settings.Instance C# (CSharp) Метод

Instance() публичный статический Метод

public static Instance ( ) : Settings
Результат Settings
            public static Settings Instance()
            {
                if (instance != null) {
                    return instance;
                }
                instance = GameComponent.Get<Settings>();
                return instance;
            }
        }

Usage Example

Пример #1
0
        public Animal(int weight, int range, animalType type, int weightGain)
        {
            this.weight     = weight;
            this.range      = range;
            this.weightGain = weightGain;
            this.type       = type;
            alive           = true;
            locationX       = random.Next(0, Settings.Instance().NumbersOfAreas);
            locationY       = random.Next(0, Settings.Instance().NumbersOfAreas);

            if (random.Next(1, 3) == 1)
            {
                this.gender = gender.male;
            }
            else
            {
                gender = gender.female;
            }
        }
All Usage Examples Of Common.Settings::Instance