void Start() { mover = GetComponent<WindsMover>(); mover.NodesBuffer.Subscribe(nodesBuffer => { material.SetBuffer(Consts.NODES, nodesBuffer); }); mover.WindsBuffer.Subscribe(windsBuffer => { material.SetBuffer(Consts.WINDS, windsBuffer); }); material.SetInt( "_NumNodesPerWind", mover.NumNodesPerWind); material.SetFloat("_NodeLife", nodeLife); material.SetFloat("_WindWidth", windWidth); tf = transform; }
void Awake() { mover = GetComponent <WindsMover>(); renderer = GetComponent <WindsRenderer>(); }