Example #1
0
        public override void Update()
        {
            if (Collapsed)
            {
                return;
            }

            if (_inputSocketNumber.IsConnected())
            {
                StartJob(_textures[0]);
            }
            else
            {
                _textures[0].Hide();
            }


            if (_inputSocketVec.CanGetResult())
            {
                UpdateVectorTexture();
            }
            else
            {
                if (_textures[1] != null)
                {
                    _textures[1].Hide();
                }
                _lastVectors = null;
            }
        }
Example #2
0
        public override void Update()
        {
            if (Collapsed)
            {
                return;
            }

            if (_inputSocketNumber.CanGetResult())
            {
                _textures[0].StartTextureUpdateJob((int)Width - 10, (int)Height - 70, GetNumberSampler(), GetColorSampler());
            }
            else
            {
                _textures[0].Hide();
            }


            if (_inputSocketPosition.CanGetResult())
            {
                _lastVectors = GetPositionSampler().GetVector3List(
                    _inputSocketPosition.GetConnectedSocket(),
                    0, 0, 0, (int)Width - 10, 0, (int)Height - 70, 0);
                _textures[1].StartTextureUpdateJob((int)Width - 10, (int)Height - 70, _lastVectors);
            }
            else
            {
                _textures[1].Hide();
                _lastVectors = null;
            }
        }
Example #3
0
 private IColorConnection GetColorSampler()
 {
     if (_inputSocketColor.CanGetResult())
     {
         return((IColorConnection)_inputSocketColor.GetConnectedSocket().Parent);
     }
     return(null);
 }
Example #4
0
 public List <Vector3> GetPositions(float x, float y, float z, float sizeX, float sizeY, float sizeZ, float seed)
 {
     if (!_inputSocketPosition.CanGetResult())
     {
         return(null);
     }
     return(AbstractVector3Node.GetInputVector3List(_inputSocketPosition, x, y, z, sizeX, sizeY, sizeZ, seed));
 }
Example #5
0
 public string GetModelFileName()
 {
     if (!_inputSocketModelName.CanGetResult())
     {
         return(null);
     }
     return(((AbstractStringNode)_inputSocketModelName.GetConnectedSocket().Parent).GetString(_inputSocketModelName.GetConnectedSocket()));
 }
Example #6
0
 private IColorSampler GetColorSampler()
 {
     if (_inputSocketColor.CanGetResult())
     {
         return((AbstractColorNode)_inputSocketColor.GetConnectedSocket().Parent);
     }
     return(null);
 }
Example #7
0
        public override UnityEngine.Material GetMaterial(OutputSocket outSocket, Request request)
        {
            if (_inputSocketColor.CanGetResult())
            {
                UnityEngine.Color c = AbstractColorNode.GetInputColor(_inputSocketColor, request);
                _material.color = c;
            }

            return(_material);
        }
Example #8
0
        public static List <UnityEngine.Vector3> GetInputVector3List(InputSocket socket, float x, float y, float z,
                                                                     float sizeX, float sizeY, float sizeZ, float seed)
        {
            if (socket.Type != typeof(AbstractVector3Node) || !socket.CanGetResult())
            {
                return(null);
            }
            AbstractVector3Node node = (AbstractVector3Node)socket.GetConnectedSocket().Parent;

            return(node.GetVector3List(socket.GetConnectedSocket(), x, y, z, sizeX, sizeY, sizeZ, seed));
        }
 public override void Update()
 {
     if (_inputSocketValue.CanGetResult())
     {
         StartTextureJob();
     }
     else
     {
         _textures[0].Hide();
     }
 }
Example #10
0
 private INumberConnection GetNumberSampler()
 {
     if (_inputSocketNumber.IsInDirectInputMode())
     {
         return(new SingleNumberSampler(GetInputNumber(_inputSocketNumber, new Request())));
     }
     if (_inputSocketNumber.CanGetResult())
     {
         return((INumberConnection)_inputSocketNumber.GetConnectedSocket().Parent);
     }
     return(null);
 }
        public static List <UnityEngine.Vector3> GetInputVector3List(InputSocket socket, Request request)
        {
            if (!socket.CanGetResult())
            {
                return(null);
            }
            IVectorConnection sampler = socket.GetConnectedSocket().Parent as IVectorConnection;

            if (sampler == null)
            {
                return(null);
            }
            return(sampler.GetVector3List(socket.GetConnectedSocket(), request));
        }