コード例 #1
0
	private 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;
		}
	}
コード例 #2
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;
        }
    }