小编bub*_*ibu的帖子

Unity 粒子系统播放和停止

我的particlesystem.Play()不行。我在这个问题上花了几个小时,但仍然无法弄清楚。

每当我的角色击中一个物体时,它就会调用该函数particleAuraPlay(),并且显示日志消息“HIT”,这意味着该函数正在正确调用。

playAura设置为 true 时,粒子应该播放,并且日志消息“正在运行”也会再次显示。由于消息显示,我认为我的逻辑是正确的,但粒子只是不会开始播放。有人可以解决我的问题吗?

using UnityEngine;
using System.Collections;

public class ParticleController : MonoBehaviour {

    private bool playAura = false;
    private ParticleSystem particleObject;

    void Start () {
        particleObject = GetComponent<ParticleSystem>();
        particleObject.Stop();
    }


    void Update () {
        if (playAura)
        {
            Debug.Log("Running");
            particleObject.Play();
        }

    }

    public void particleAuraPlay()
    {
        Debug.Log("HIT");
        playAura = true;
    }
}
Run Code Online (Sandbox Code Playgroud)

c# unity-game-engine

6
推荐指数
1
解决办法
2万
查看次数

R小册子如何点击地图并添加一个圆圈

嗨,大家好,我已经尝试了几个星期,但我无法完成它.R传单的在线资源也不够.真的需要完成这件事.

请帮忙,非常感谢你.

ui.R - >

library(shiny)
library(ggmap)
library(leaflet)

shinyUI(bootstrapPage(
  leafletOutput("map"),
  br(),
  verbatimTextOutput("out")
)
)
Run Code Online (Sandbox Code Playgroud)

server.R - >

library(shiny)
library(ggmap)
library(leaflet)


shinyServer(function(input, output, session) {


output$map <- renderLeaflet({

 p <- input$map_click

 if(is.null(p)){
   leaflet() %>% setView(lng = -43.1729, lat = -22.9068, zoom = 11) %>%
     addTiles(options = providerTileOptions(noWrap = TRUE)) 
 }

 else{
   address <- revgeocode(c(p$lng,p$lat))

   leaflet() %>% setView(lng = p$lng, lat = p$lat, zoom = 16) %>%
   addTiles(options = providerTileOptions(noWrap = TRUE)) %>%
   addCircles(p$lng, p$lat, weight = 1, radius = 100, color …
Run Code Online (Sandbox Code Playgroud)

r leaflet shiny

-4
推荐指数
1
解决办法
4047
查看次数

标签 统计

c# ×1

leaflet ×1

r ×1

shiny ×1

unity-game-engine ×1