// 模拟列表数据const list =[{height:300,background:"red",},{height:400,background:"pink",},{height:500,background:"blue",},{height:200,background:"green",},{height:300,background:"gray",},{height:400,background:"#CC00FF",},{height:200,background:"gray",},{height:100,background:"#996666",},{height:500,background:"skyblue",},{height:300,background:"#993366",},{height:100,background:"#33FF33",},{height:400,background:"skyblue",},{height:200,background:"#6633CC",},{height:300,background:"#666699",},{height:300,background:"#66CCFF",},{height:300,background:"skyblue",},{height:200,background:"#CC3366",},{height:200,background:"#CC9966",},{height:200,background:"#FF00FF",},{height:500,background:"#990000",},{height:400,background:"red",},{height:100,background:"#999966",},{height:200,background:"#CCCC66",},{height:300,background:"#FF33FF",},{height:400,background:"#FFFF66",},{height:200,background:"red",},{height:100,background:"skyblue",},{height:200,background:"#33CC00",},{height:300,background:"#330033",},{height:100,background:"#0066CC",},{height:200,background:"skyblue",},{height:100,background:"#006666",},{height:200,background:"yellow",},{height:300,background:"skyblue",},{height:120,background:"#33CCFF",},{height:400,background:"#999966",},{height:630,background:"#CC9966",},{height:250,background:"#33FF00",},{height:300,background:"yellow",},{height:500,background:"green",},];
子组件
<template><divclass="list"><divclass="item"v-for="(item, index) in waterList":style="{width: width + 'px',height: item.height + 'px',left: item.left + 'px',top: item.top + 'px',background: item.background,}">{{ index }}</div></div></template>
你想让鼠标点击哪里,你的运动的对象就运动到哪里吗?
Please follow me !
首先,你要先添加一个Plane ,以及你的围墙,你的移动的物体 想要实现跟随鼠标移动,我们先创建一个脚本
using System.Collections;
using Syst…