unity3d

C# cant find a unity auto generated class

浪尽此生 提交于 2021-02-16 15:08:02
问题 Okay so I'm learning to use the new InputActions and I've created a C# scripts using https://prnt.sc/oyaj5l And this is what I got: // GENERATED AUTOMATICALLY FROM 'Assets/PlayerControls.inputactions' using System.Collections; using System.Collections.Generic; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; public class PlayerControls : IInputActionCollection { private InputActionAsset asset; public PlayerControls() { /// } } But when I try to create an PlayerControls

C# cant find a unity auto generated class

北城余情 提交于 2021-02-16 15:07:31
问题 Okay so I'm learning to use the new InputActions and I've created a C# scripts using https://prnt.sc/oyaj5l And this is what I got: // GENERATED AUTOMATICALLY FROM 'Assets/PlayerControls.inputactions' using System.Collections; using System.Collections.Generic; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Utilities; public class PlayerControls : IInputActionCollection { private InputActionAsset asset; public PlayerControls() { /// } } But when I try to create an PlayerControls

Unity: GetComponent<BaseClass<T>> - are there any workarounds for this?

感情迁移 提交于 2021-02-16 13:00:19
问题 If an object has a component with a baseclass BaseClass<T> , calling GetComponent<BaseClass<T>>() will not return that component. The generic argument seems to throw it off, as a BaseClass without using generics will correctly return the derived class as a component when GetComponent<BaseClass>() is called. Does anyone know a solid workaround for this? The use of a generic arg in this class is somewhat important, so I'd obviously rather not re-write the program's class structure just to

Maya学习笔记

大城市里の小女人 提交于 2021-02-16 08:47:10
软件: Maya 2016 ; 参考教材: Maya 2016 中文版标准教程 ; 改变视图颜色 【窗口】|【设置/首项选择】|【颜色设置】|【3D视图】; 观察视图 旋转视图 Alt + 鼠标左键 ; 移动视图 Alt + 鼠标中键 ; 推拉视图 - Alt + 鼠标右键 / 中键滚动 ; 创建物体 【选择建模状态】|【创建】|【多边形基本体】|【球体】 - - 点击后面那个小方格创建可以改变初始参数; - - 当然,创建完也可以修改 —— 选中物体,然后在右边点击展开 ; - 转换显示模式 线框模式 —— 数字 4 - 实体模式 —— 数字5 - 操作物体常用的快捷键 选中物体 —— Q - 移动物体 —— W - 旋转物体 —— E - 缩放物体 —— R - 选择对象类型 f8 状态栏中的这三个键可以改变你选择的对象的类型; - - 依次是按层次和组合选择 - - 按对象类型选择 - - 按组件类型选择 - - 选择按组件类型可以随意拖动物体的每一块组件喔! - 物体的组合 组合物体 - 【选中】|【编辑】|【分组】 / Ctrl + G 查看组 - 【窗口】|【大纲视图】 - 解散组 - 【编辑】|【解组】 父子关系 创建父子关系 - 选中A物体,按住shift ,再选中B物体,执行【编辑】|【父对象】 / P ; - 此时第一个选中的物体A为子对象

im getting the warning: You are trying to create a MonoBehaviour using the 'new' keyword [duplicate]

。_饼干妹妹 提交于 2021-02-15 07:58:10
问题 This question already has answers here : Declaring a new instance of a class in C# (2 answers) Closed 7 days ago . The full warning msg: You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed. MonoBehaviours can only be added using AddComponent(). Alternatively, your script can inherit from ScriptableObject or no base class at all Im trying to make an inventory to my game i followed the code from BLACKTHORNPROD but there is no stack item so i'm trying to modify

im getting the warning: You are trying to create a MonoBehaviour using the 'new' keyword [duplicate]

∥☆過路亽.° 提交于 2021-02-15 07:57:50
问题 This question already has answers here : Declaring a new instance of a class in C# (2 answers) Closed 7 days ago . The full warning msg: You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed. MonoBehaviours can only be added using AddComponent(). Alternatively, your script can inherit from ScriptableObject or no base class at all Im trying to make an inventory to my game i followed the code from BLACKTHORNPROD but there is no stack item so i'm trying to modify

Unity AssetBundle 分割与合并

荒凉一梦 提交于 2021-02-14 22:48:26
介绍 Unity AssetBundle 中的资源非常容易被提取,如果想要阻止简单的提取行为,可以尝试在打包时将文件分割,在运行时将文件合并。 打包 打包时将文件分割成多个文件,这个可以根据需要指定规则处理。例如可以使用随机文件名、分割成随机的份数。 加载 LoadFromStream Unity 2017.4 Unity 2018.4 Unity 2019.3 Unity 2020.1 或更高版本新增了一个从流读取 AssetBundle 的 API,那么可以将多个文件合并为一个文件流供 API 使用。 Unity - Scripting API: AssetBundle.LoadFromStream 虽然通过这个 API 可以自定义 AssetBundle 加载方式,包括加密、多文件读取、内存中读取等等。但是有一个致命缺点:使用时占用文件打开数量,而操作系统对文件打开数量是有上限的。 5.5.4. iOS file handle overuse Current versions of Unity are not affected by this issue. In versions prior to Unity 5.3.2p2, Unity would hold an open file handle to an AssetBundle the entire time that

Unity AssetBundle 教程

自古美人都是妖i 提交于 2021-02-14 21:55:05
Unity AssetBundle 教程 AssetBundle是Unity用来处理资源热更新的,下面简单介绍AssetBundle的所有操作。本教程使用的Unity版本:Unity 2018.2.12f1 (64-bit) AssetBundle打包 设置AssetBundle名字 手动设置 打包之前按照上图所示的方法,设置一下AssetBundle的名字。 自动设置 将需要进行AssetBundle打包的图片按照“UI_”的前缀命名,然后根据图片的父目录来设置AssetBundle的名字。如下所示 然后新建一个ImageImporter.cs文件放入Editor目录下 using UnityEngine; using UnityEditor; /// <summary> /// 根据名字前缀自动化设置图片的格式以及TAG等设置 /// </summary> public class ImageImporter : AssetPostprocessor { /// <summary> /// 图片导入之前调用,可设置图片的格式、spritePackingTag、assetBundleName等信息 /// </summary> void OnPreprocessTexture() { TextureImporter importer = (TextureImporter

Unity3D 中的灯光与渲染

纵然是瞬间 提交于 2021-02-14 18:55:48
最近仔细研究了Unity3D中的灯光以及渲染,有了全新的认识,在这里整理记录下来。博主所使用的是Unity3D 2017.3.1f1这个版本。 一、 Unity3D中的灯光 Directional Light :平行光,用来模拟太阳发射的光。 Point Light :点光源,用于模拟场景中的灯和其他本地光源。 Spot Light :聚光灯,通常用于人造光源,如手电筒,汽车前灯和探照灯。 Area Light :区域光,只能用于烘焙中。 Reflection Group :反射探针,用于准确反射周围环境。 Light Probe Group :灯光探针组,用于记录场景中光照信息,实时影响物体。 Environment Lighting :环境光。场景的整体外观和亮度的主要依靠于环境光,环境光是从各个方面来影响对象的。 Emissive Materials :自发光材质,类似于区域光,只能使用在静态物体中,并且只能照明静态物。 二、 Unity3D 中虚拟环境的组成 Unity3D 中虚拟环境由天空盒、环境光、环境反射以及场景中的光源共同构成。我们按照下面的步骤,可以将场景还原到最原始的状态:   1、关闭场景中的所有灯光。   2、 进入 Window->Lighting->Setting->Scene 窗口。   3、 设置 Environment->Skybox

ipfa正舵者IPFS官方周报

半世苍凉 提交于 2021-02-14 18:52:40
IPFS+Filecoin的演变 在准备Filecoin的提升周之前,我们的一些生态系统领导人分享了他们对我们与IPFS和Filecoin一起构建的Web3生态系统的动机和增长的看法。IPFS和Filecoin创始人Juan Benet,Textile联合创始人兼首席执行官Andrew Hill都在Twitter上分享了他们的想法。 互联网的未来将由技术创新者决定 Web3,IPFS和Filecoin最近成为舆论关注的焦点,该论点是针对Marvin Ammori撰写的针对五家主要科技公司所拥有的不平衡的权力平衡问题而提出的去中心化优点的。请继续阅读以了解Web 2.0的遗留知识,以及监管如何对您有帮助或有害。 Infura推出对Filecoin开发者的支持 我们Infura的朋友最近通过Filecoin Network API Beta交付了对Filecoin的支持,部分用户现在可以加入。Beta版允许开发人员连接到Filecoin主网,并使用Infura仪表板构建基于Filecoin的应用程序。将您的应用程序连接到Filecoin从未如此简单! 全新的IPFS 展示js-ipfs-fetch,这是一个为ipfs://和ipns://提供获取接口的模块。 教程:该视频来自3Box社区,使用Vue.js和3Box构建“ Twitter” Dapp。