Exemple #1
0
    private void ChangeSkin(ObjectType objectType)
    {
        playerType = objectType;

        switch (objectType)
        {
        case ObjectType.FRIEND:
            circleTransformRenderer.color = gameParameters.friendFill;
            break;

        case ObjectType.HOLE:
            circleTransformRenderer.color = gameParameters.holeFill;
            labelText.GetComponent <MeshRenderer>().enabled = false;
            break;

        case ObjectType.ENEMY_SIMPLE:
            circleTransformRenderer.color = gameParameters.enemy1Fill;
            break;

        case ObjectType.ENEMY_GROW:
            circleTransformRenderer.color = gameParameters.enemy2Fill;
            break;

        case ObjectType.ENEMY_DOUBLE:
            circleTransformRenderer.color = gameParameters.enemy3Fill;
            break;
        }

        OnTypeChanged?.Invoke();
    }
        public void ChangeParameterType(ValueProviderType parameterType, ValueProviderType previousParameterType)
        {
            RemoveFromClassList("bool");
            RemoveFromClassList("int");
            RemoveFromClassList("float");
            RemoveFromClassList("trigger");

            switch (parameterType)
            {
            case ValueProviderType.Bool:
                AddToClassList("bool");
                break;

            case ValueProviderType.Int:
                AddToClassList("int");
                break;

            case ValueProviderType.Float:
                AddToClassList("float");
                break;

            case ValueProviderType.Trigger:
                AddToClassList("trigger");
                break;

            default:
                break;
            }

            OnTypeChanged?.Invoke(this, previousParameterType, parameterType);
            //OutputPort.ChangeValueProviderType(parameterType);
        }
Exemple #3
0
    private void UpdateSize()
    {
        var hpCoeff      = (healthPoints - gameParameters.minHPValue) / (gameParameters.maxHPValue - gameParameters.minHPValue);
        var currDiameter = gameParameters.minHPDiameter + (gameParameters.maxHPDiameter - gameParameters.minHPDiameter) * hpCoeff;

        circleTransform.localScale             = Vector3.one * currDiameter;
        circleOutlinerMaskTransform.localScale = circleTransform.localScale;
        circleOutlinerTransform.localScale     = circleTransform.localScale + Vector3.one * 0.1f;

        labelText.text = Health + "";

        if (healthPoints >= gameParameters.maxHPValue)
        {
            OnTypeChanged?.Invoke();
        }
    }
Exemple #4
0
        private void OnAntTypeChangedHandler()
        {
            OnTypeChanged?.Invoke();

            if (HasUnitsOfType && defaultType != null && defaultType == types[antType.value - 1] && defaultCount >= 0)
            {
                antCountSlider.value = Mathf.Min((float)defaultCount, GameplayManager.Instance.Player.Anter.GetFreeAnts(types[antType.value - 1])) / GameplayManager.Instance.Player.Anter.GetFreeAnts(types[antType.value - 1]);
            }
            else
            {
                antCountSlider.value = 1;
            }

            OnAntCountChangedHandler();
            canChoseCount.value = HasUnitsOfType;
        }
Exemple #5
0
 /// <summary>
 /// Sets the block to a certain type and copy its shape
 /// </summary>
 /// <param name="type">The type to set</param>
 public void SetBlockType(BlockType type)
 {
     Type   = type;
     Values = (Boolean[, ])BlockTypes[type].Clone();
     OnTypeChanged.Invoke(type);
 }
Exemple #6
0
 void FireTypeChangedEvent(int type)
 {
     OnTypeChanged?.Invoke(Index, TypeDropdown.options[type].text);
 }
Exemple #7
0
 private void TypeChanged(string s)
 {
     OnTypeChanged?.Invoke(s);
 }