Example #1
0
    EZData.Property GetPropertyByType(Type type)
    {
        EZData.Property pr = new EZData.Property();

        if (type == typeof(string))
        {
            pr = new EZData.Property <string> ();
        }
        else if (type == typeof(float))
        {
            pr = new EZData.Property <float> ();
        }
        else if (type == typeof(int))
        {
            pr = new EZData.Property <int> ();
        }

//		switch (type) {
//		case typeof(string):
//
//			break;
//		case typeof(float):
//			pr = new EZData.Property<float> ();
//			break;
//		case typeof(int):
//			pr = new EZData.Property<int> ();
//			break;
//		}
        return(pr);
    }
Example #2
0
    public override void Bind()
    {
        var context = GetContext(Path);

        if (context == null)
        {
            Debug.LogWarning("NguiColorBinding.UpdateBinding - context is null");
            return;
        }

        _colorProperty = context.FindProperty <Color>(Path, this);
        if (_colorProperty == null)
        {
            _hexProperty = context.FindProperty <string>(Path, this);
        }

        if (_colorProperty != null)
        {
            _colorProperty.OnChange += OnChange;
        }
        if (_hexProperty != null)
        {
            _hexProperty.OnChange += OnChange;
        }

        OnChange();
    }
Example #3
0
    protected override void Unbind()
    {
        base.Unbind();

        if (_shader != null)
        {
            _shader.OnChange -= OnChange;
            _shader           = null;
        }
    }
Example #4
0
    protected override void Unbind()
    {
        base.Unbind();

        if (_grayscale != null)
        {
            _grayscale.OnChange -= OnChange;
            _grayscale           = null;
        }
    }
Example #5
0
    protected override void Unbind()
    {
        base.Unbind();

        if (_alpha != null)
        {
            _alpha.OnChange -= OnChange;
            _alpha           = null;
        }
    }
    protected override void Unbind()
    {
        base.Unbind();

        if (_activateProperty != null)
        {
            _activateProperty.OnChange -= OnChange;
            _activateProperty           = null;
        }
    }
Example #7
0
    protected override void Unbind()
    {
        base.Unbind();

        if (_clip != null)
        {
            _clip.OnChange -= OnChange;
            _clip           = null;
        }
    }
Example #8
0
    protected override void Unbind()
    {
        base.Unbind();

        if (_cameraParameter != null)
        {
            _cameraParameter.OnChange -= OnChange;
            _cameraParameter           = null;
        }
    }
Example #9
0
    protected override void Unbind()
    {
        base.Unbind();

        if (_animatorParameter != null)
        {
            _animatorParameter.OnChange -= OnChange;
            _animatorParameter           = null;
        }
    }
Example #10
0
    public override void Unbind()
    {
        base.Unbind();

        if (_texture != null)
        {
            _texture.OnChange -= OnChange;
            _texture           = null;
        }
    }
Example #11
0
    protected override void Unbind()
    {
        base.Unbind();

        if (_masterVolumeProperty != null)
        {
            _masterVolumeProperty.OnChange -= ApplyVolume;
        }
        _masterVolumeProperty = null;
    }
Example #12
0
 public override void Unbind()
 {
     if (_hexProperty != null)
     {
         _hexProperty.OnChange -= OnChange;
         _hexProperty           = null;
     }
     if (_colorProperty != null)
     {
         _colorProperty.OnChange -= OnChange;
         _colorProperty           = null;
     }
 }
	private EZData.Property<string> GetDisplayValueProperty(EZData.Context item)
	{
		if (item == null)
			return null;
		
		EZData.Property<string> property = null;
		if (_displayValuesCache.TryGetValue(item, out property))
			return property;
		property = item.FindProperty<string>(DisplayValuePath, this);
		if (property != null)
			_displayValuesCache.Add(item, property);
		return property;
	}
Example #14
0
    protected override void Bind()
    {
        var context = GetContext(MasterVolume);

        if (context != null)
        {
            _masterVolumeProperty = context.FindProperty <float>(MasterVolume, this);
        }

        if (_masterVolumeProperty != null)
        {
            _masterVolumeProperty.OnChange += ApplyVolume;
        }

        base.Bind();
    }
Example #15
0
    public void Bind(NguiDataContext context)
    {
        _v3property = context.FindProperty <Vector3>(Path, this);
        if (_v3property != null)
        {
            _v3property.OnChange += OnChange;
            return;
        }

        _v2property = context.FindProperty <Vector2>(Path, this);
        if (_v2property != null)
        {
            _v2property.OnChange += OnChange;
            return;
        }

        _t2property = context.FindProperty <Texture2D>(Path, this);
        if (_t2property != null)
        {
            _t2property.OnChange += OnChange;
            return;
        }

        _transformProperty = context.FindProperty <Transform>(Path, this);
        if (_transformProperty != null)
        {
            _transformProperty.OnChange += OnChange;
            return;
        }

        _componentProperty = context.FindProperty <Component>(Path, this);
        if (_componentProperty != null)
        {
            _componentProperty.OnChange += OnChange;
            return;
        }

        _gameObjectProperty = context.FindProperty <GameObject>(Path, this);
        if (_gameObjectProperty != null)
        {
            _gameObjectProperty.OnChange += OnChange;
            return;
        }
    }
Example #16
0
    protected override void Bind()
    {
        base.Bind();

        var context = GetContext(Path);

        if (context == null)
        {
            Debug.LogWarning("NguiTexture.UpdateBinding - context is null");
            return;
        }

        _shader = context.FindProperty <Shader>(Path, this);

        if (_shader != null)
        {
            _shader.OnChange += OnChange;
        }
    }
    protected override void Bind()
    {
        base.Bind();

        var context = GetContext(Path);

        if (context == null)
        {
            Debug.LogWarning("NguiStartPlayEffect.UpdateBinding - context is null");
            return;
        }

        _activateProperty = context.FindProperty <bool>(Path, this);

        if (_activateProperty != null)
        {
            _activateProperty.OnChange += OnChange;
        }
    }
Example #18
0
    protected override void Bind()
    {
        base.Bind();

        var context = GetContext(Path);

        if (context == null)
        {
            Debug.LogWarning("NguiAnimation.UpdateBinding - context is null");
            return;
        }

        _clip = context.FindProperty <string>(Path, this);

        if (_clip != null)
        {
            _clip.OnChange += OnChange;
        }
    }
Example #19
0
    protected override void Bind()
    {
        base.Bind();

        var context = GetContext(Path);

        if (context == null)
        {
            Debug.LogWarning("NguiTexture.UpdateBinding - context is null");
            return;
        }

        _grayscale = context.FindProperty <bool>(Path, this);

        if (_grayscale != null)
        {
            _grayscale.OnChange += OnChange;
        }
    }
Example #20
0
    public override void Bind()
    {
        base.Bind();

        var context = GetContext(Path);

        if (context == null)
        {
            Debug.LogWarning("NguiTexture.UpdateBinding - context is null");
            return;
        }

        _texture = context.FindProperty <Texture2D>(Path, this);

        if (_texture != null)
        {
            _texture.OnChange += OnChange;
        }
    }
Example #21
0
    protected override void Bind()
    {
        base.Bind();

        var context = GetContext(Path);

        if (context == null)
        {
            //Debug.LogWarning("NguiAlpha.UpdateBinding - context is null");
            return;
        }

        _alpha = context.FindProperty <float>(Path, this);

        if (_alpha != null)
        {
            //Debug.LogError ("NguiAlpha binding");
            _alpha.OnChange += OnChange;
        }
    }
Example #22
0
    protected override void Bind()
    {
        base.Bind();

        var context = GetContext(Path);

        if (context == null)
        {
            Debug.LogWarning("NguiCamera.UpdateBinding - context is null");
            return;
        }

        _cameraParameter = context.FindProperty <Camera>(Path, this);

        if (_cameraParameter != null)
        {
            _cameraParameter.OnChange += OnChange;
            if (_camera != null)
            {
                _cameraParameter.SetValue(_camera);
            }
        }
    }
Example #23
0
    protected override void Bind()
    {
        base.Bind();

        var context = GetContext(Path);

        if (context == null)
        {
            Debug.LogWarning("NguiAnimation.UpdateBinding - context is null");
            return;
        }

        _animatorParameter = context.FindProperty <Animator>(Path, this);

        if (_animatorParameter != null)
        {
            _animatorParameter.OnChange += OnChange;
            if (_animator != null)
            {
                _animatorParameter.SetValue(_animator);
            }
        }
    }
Example #24
0
    public override void Unbind()
    {
        base.Unbind();

        if (_gameObjectProperty != null)
        {
            _gameObjectProperty.OnChange -= OnChange;
        }
        if (_componentProperty != null)
        {
            _componentProperty.OnChange -= OnChange;
        }
        if (_transformProperty != null)
        {
            _transformProperty.OnChange -= OnChange;
        }
        if (_v3property != null)
        {
            _v3property.OnChange -= OnChange;
        }
        if (_v2property != null)
        {
            _v2property.OnChange -= OnChange;
        }
        if (_t2property != null)
        {
            _t2property.OnChange -= OnChange;
        }

        _gameObjectProperty = null;
        _componentProperty  = null;
        _transformProperty  = null;
        _v3property         = null;
        _v2property         = null;
        _t2property         = null;
    }