Fungus插件_插件大师

Fungus插件_插件大师一个任务的fungus声明fungus设置一个开关,当触发碰撞器时,将开关打开,当在持续碰撞时如是碰到的是人物,并且按下空格且开关为开,就执行对话重载名字并且关闭开关//多个任务的时候就是加个else其他都一样usingSystem;usingSystem.Collections;usingSystem.Collections.Generic;usingFungus;usingUnityEngine;publicclassFungunNpcGrandFather:.

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全家桶1年46,售后保障稳定

一个任务的fungus
声明fungus  设置一个开关,当触发碰撞器时,将开关打开,当在持续碰撞时如是碰到的是人物,并且按下空格且开关为开,就执行对话重载名字并且关闭开关//多个任务的时候就是加个else 其他都一样

using System;
using System.Collections;
using System.Collections.Generic;
using Fungus;
using UnityEngine;

public class FungunNpcGrandFather : MonoBehaviour
{
    private AllTask _allTask;
    private Flowchart flowChart;
    private bool _canSay;

    private void Start()
    {
        _allTask = GameObject.Find("CanvasScene").transform.GetChild(0).GetChild(7).GetComponent<AllTask>();
        flowChart = GameObject.Find("Flowchart").GetComponent<Flowchart>();
    }

    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.CompareTag("Player"))
        {
            _canSay = true;
        }
    }

    private void OnTriggerStay(Collider other)
    {
        if (other.gameObject.CompareTag("Player"))
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                if (_allTask.enemyNum>=50&&_canSay)
                { 
                    //执行对话
                    flowChart.ExecuteBlock("Task4");
                    _canSay = false;
                }
                else if (_canSay)
                {
                    //执行对话
                    flowChart.ExecuteBlock("Task3");
                    _canSay = false;
                }
                
            }
        }
    }
}








using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices.ComTypes;
using Fungus;
using UnityEngine;
using UnityEngine.EventSystems;
using Collision = UnityEngine.Collision;

public class FungusNpc : MonoBehaviour
{
    public string chatName;
    private bool _canSay;
    private Flowchart _flowChart;
    

    private void Start()
    {
        _flowChart = GameObject.Find("Flowchart").GetComponent<Flowchart>();
    }


    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.CompareTag("Player"))
        {
            _canSay = true;
        }
    }

    private void OnTriggerStay(Collider other)
    {
        if (other.gameObject.CompareTag("Player"))
        {
            if (Input.GetKeyDown(KeyCode.Space))
            {
                if (_canSay)
                {
                    //执行对话
                    _flowChart.ExecuteBlock(chatName);
                    _canSay = false;
                }
            }
        }
    }
}

Jetbrains全家桶1年46,售后保障稳定

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/210189.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • 【转载】究竟啥才是互联网架构“高可用”

    【转载】究竟啥才是互联网架构“高可用”

    2021年11月20日
  • kali修改更新源(无法安全的用该源更新)

    因为kali是国外的,所以一些软件你要下载的话得从国外的网站下载,就会很慢,国内一些公司或者学校提供了国内的下载地址,所以我们需要更换更新源一,命令:vim/etc/apt/sources.list二、增加或替换掉sources.list文件里面的更新源地址:#阿里云debhttp://mirrors.aliyun.com/kalikali-rollingmain…

  • springaop与aspectjweaver

    springaop与aspectjweaverorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname’sysScheduleUserDateServiceImpl’definedinURL[jar:file:/C:/Users/Administrator/.m2/repository/com/ruoyi/ruoyi-schedule-one/3.4.0/ruoyi-schedule-one-3.4.0.jar!/com/ruo

  • python抛出异常和捕获异常_Python异常

    python抛出异常和捕获异常_Python异常抛出异常:classWidget:def__init__(self,size=(40,40)):self._size=sizedefgetSize(self):returnself._sizedefresize(self,width,height):ifwidth&lt;0orheight&lt…

    2022年10月17日
  • 回归模型中的u_什么是面板回归模型

    回归模型中的u_什么是面板回归模型文章目录最简单的RNN回归模型入门(PyTorch版)RNN入门介绍PyTorch中的RNN代码实现与结果分析版权声明:本文为博主原创文章,转载请注明原文出处!写作时间:2019-03-0212:46:15本文部分图片素材来自互联网,如有侵权,请联系作者删除!最简单的RNN回归模型入门(PyTorch版)RNN入门介绍至于RNN的能做什么,擅长什么,这里不赘述。如果不清楚,请先维基一…

    2022年10月20日
  • 如何使用keil 5 编写 51单片机 工程

    如何使用keil 5 编写 51单片机 工程目前我们通常编写51程序使用的是keil4,而好多编写STM32等单片机程序的使用keil5。那么如何在keil5中兼容51和STM32程序编写,省去切换版本的繁琐呢?很简单只需两步就可以完成。下面这个方法针对已破解keil5的stm32等一系列。这个肯定是最常见的,因为破解keil5然后编写32工程的教程一大把。1、首先下载编写51的相关东西。可以在官网上下载,例如百度keil官

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号