示例#1
0
 private bool IsSpawnObject(ActionObjectType type)
 {
     if (type == ActionObjectType.Spawn || type == ActionObjectType.UpgradeSpawn)
     {
         return(true);
     }
     return(false);
 }
示例#2
0
 private bool IsActionObject(ActionObjectType type)
 {
     if (type == ActionObjectType.Action || type == ActionObjectType.Phisics)
     {
         return(true);
     }
     return(false);
 }
示例#3
0
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            var token             = JToken.ReadFrom(reader);
            ActionObjectType type = token["type"].ToObject <ActionObjectType>();

            switch (type)
            {
            case ActionObjectType.User:
                return(token.ToObject <VKNotificationProfile>());

            case ActionObjectType.Group:
                return(token.ToObject <VKNotificationGroup>());
            }

            throw new InvalidOperationException("Не удалось десериализовать объект-инициатор оповещения.");
        }
示例#4
0
    private void SendObjectToSpawner(IGeneratedBy actionObject)
    {
        ActionObjectType sendableObjectType = actionObject.ActionObject.ObjectType;

        if (IsActionObject(sendableObjectType))
        {
            if (!(actionObject as ActionObjectScriptableObject).IsOpeningObject)
            {
                _commercial.ShowInterstitial();
            }

            _actionObjectSpawner.SetObjectOnScene(actionObject);
        }
        else if (IsSpawnObject(sendableObjectType))
        {
            //_commercial.ShowRewardedVideo(false);
            _spawnObjectSpawner.SetObjectOnScene(actionObject);
        }
    }
示例#5
0
    public int GetPrice(float price, ActionObjectType objectType)
    {
        int count = ObjectOnScene.GetCount(objectType);

        if (count != 0)
        {
            if (objectType == ActionObjectType.Action || objectType == ActionObjectType.Phisics || objectType == ActionObjectType.Spawn)
            {
                return((int)(price * GetСoefficient(count) * _objectIncrease));
            }
            else if (objectType == ActionObjectType.UpgradeSpawn || objectType == ActionObjectType.UpgradeScorre)
            {
                return((int)(price * GetСoefficient(count) * _upgradeIncrease));
            }
            return((int)price);
        }
        else
        {
            return((int)price);
        }
    }
示例#6
0
 public int GetCount(ActionObjectType objectType)
 {
     return(ObjectOnScene.GetCount(objectType));
 }
 private void ChangeCount(ActionObjectType objectType, int value)
 {
     ref int _currentCount = ref GetCorrectCounter(objectType);
 public int GetCount(ActionObjectType objectType)
 {
     return(GetCorrectCounter(objectType));
 }
 public void SetCount(ActionObjectType objectType, int value)
 {
     ChangeCount(objectType, value);
 }
 public void AddCount(ActionObjectType objectType)
 {
     ChangeCount(objectType, 1);
 }