我正在 JavaScript(属性)中设置 CSS 效果filter,并在下一行中将该属性设置为none. 我的图像等于filter,none但我想用 来实现transition。
如果没有最后一行(当 I\xe2\x80\x99m 将属性设置回 时none),如果我filter在控制台中禁用该属性,则它可以与 一起使用transition。
loadImg.style.filter = `blur(${value})`;\nloadImg.style.transition = `-webkit-filter ${transitionDuration} ${timing} ${delay}`;\nloadImg.style.filter = 'none';\nRun Code Online (Sandbox Code Playgroud)\n\n我知道它\xe2\x80\x99s是因为JavaScript,但我不知道如何让它与transition.
我试图在Y轴上逐个产生+0.6空间的对象.对象应该是0.6,1.2,1.8,2.4,3等,而它看起来像0.6,1.8,3.6,6,9等.我不知道发生了什么,所以我希望你能帮助我,这是一个代码:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Spawner : MonoBehaviour {
public GameObject cubeOne, cubeDouble, cubeTriple, cubeQuattro, cubeOneShort, cubeDoubleShort, cubeTripleShort, cubeQuattroShort, sphereOne, sphereDouble, sphereTriple, sphereQuattro, sphereOneShort, sphereDoubleShort, sphereTripleShort, sphereQuattroShort;
int whatToSpawn;
float position;
int yRotation;
void Update () {
whatToSpawn = Random.Range(1, 5);
position += 0.6f;
Vector3 newPosition = transform.position;
newPosition.y += position;
switch (whatToSpawn)
{
case 1:
Instantiate(cubeOne, transform.position = newPosition, transform.rotation * Quaternion.Euler(90, 0, 0));
Debug.Log(position);
break;
case 2:
Instantiate(cubeDouble, transform.position = newPosition, transform.rotation * Quaternion.Euler(90, …Run Code Online (Sandbox Code Playgroud)