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,售后保障稳定

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

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

(0)
上一篇 2025年7月26日 下午6:22
下一篇 2025年7月26日 下午7:01


相关推荐

  • strstr(str1,str2)函数使用时注意事项

    strstr(str1,str2)函数使用时注意事项可能有的人还没听过strstr函数,个人认为这个一个很实用的函数,strstr(str1,str2)函数是字符串处理函数之一,位于头文件“string.h”中。对于处理字符串的一些问题有很大的帮助。定义:strstr(str1,str2)函数用于判断字符串str2是否是str1的子串。如果是,则该函数返回str2在str1中首次出现的地址;否则,返回NULL。定义说的有点羞涩难懂。举个例子就…

    2022年6月25日
    37
  • FIO详解

    FIO详解fio FlexibleIOTe 安装 a 下载地址 http freshmeat sourceforge net projects fio b 安装两个插件 yuminstallli yuminstallzi c 编译安装 tar xvffio 2 1 10 tar gz cdfio 2 1 10 configure mak

    2026年3月19日
    2
  • LDAP 中的 RDN「建议收藏」

    LDAP 中的 RDN「建议收藏」什么是RDN,RDN和DN又有什么关系呢?很多第一次接触到LDAP的童鞋,经常会被一堆名字搞得晕头转向。RDN(relativedistinguishedname)中文翻译就是相对专有名字。一般指dn逗号最左边的部分,如cn=baby。DN是由多个RDN组织而成的。CN=cwikius,ou=Users,dc=jumpcloud,dc=com上面的RDN就不是一个了,这个DN的RDN就有4个,分别是:CN=cwikius ou=Use

    2022年6月18日
    47
  • java resourcebundle properties_Java使用Properties类和ResourceBundle类读取properties文件

    java resourcebundle properties_Java使用Properties类和ResourceBundle类读取properties文件一 介绍 项目中经常把一些常用的用户名和密码都填写到一个对应的配置文件中 这样每次修改密码或者用户名的时候就可以直接修改这个配置文件了 不用动源码 这里讲两种方式读取 properties 文件的方法 一个是用 HashTable 下的 Properties 类一个是用国际化的 ResourceBund 类 二 第一种 Properties 类读取 properties 配置文件下面的代码是在一个 web 工程中运行的

    2026年3月26日
    2
  • NSUserDefaults数据保存报错:Attempt to set a non property list object

    NSUserDefaults数据保存报错:Attempt to set a non property list object

    2022年3月12日
    50
  • Yarn 安装与使用详细介绍「建议收藏」

    Yarn 安装与使用详细介绍「建议收藏」背景什么是Yarn速度快离线模式可靠可确定性网络优化扁平化模式版本控制其他关于Yarn的介绍Yarn安装windowsmac方式一方式二Yarn换源背景在Node生态系统中,依赖通常安装在项目的node_modules文件夹中。然而,这个文件的结构和实际依赖树可能有所区别,因为重复的依赖可以合并到一起。npm客户端把依…

    2022年5月26日
    62

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

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