0%

前言

我知道没人爱看理论文章。

可偶尔也得定期坐下来写点枯燥的设计理论文章,以防本旗舰彻底变成一个专业游戏评论博客。虽然我在写评论的时候从来都是本着“写评论是为了写设计要点”的方针,但是这事情干多了,还是不免会陷入就事论事的陷阱之中。

阅读全文 »

定义实体和组件

  • SemanticObject 为gameobject添加各种component
  • Traits : 相当于component.可以定义各种属性

定义处理系统

阅读全文 »

img

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
public class shishi : MonoBehaviour
{
public CameraSizeHandler CameraSize01;

[System.Serializable]
public class CameraSizeHandler
{
public Color BackgroundColor = Color.gray;
public Rect ViewPortRect = new Rect(0.0f, 0.0f, 1.0f, 1.0f);
public RectOffset ViewPortOffset;
public Vector2 CanvasMargin = new Vector2(22.0f, 22.0f);
public float MaxSpeed = 1000.0f;
bool enabled = false;
}
}

现在有一个需求,想改一改CameraSize01这个字段的名字,比如想修改为CameraSize02,并且需要将之前在监视器面板中为CameraSize01设置的各项值保留下来,如果直接修改,则会丢失属性中的值

阅读全文 »

  • skills 相当于 采矿技能,种植技能 ,制作技能

  • level templates 只是升级属性..比如角色等级,skill等级.weapon等级

  • weapontemplates 相当于拳法精通..斧头精通..枪法精通.棍法精通这些..而且有相关的技能和属性

  • Races 种族,定义了可选职业,以及 weapontemplates ,以及初始stat等

  • classes 职业定义了stat以及技能树,和魔法书

工欲善其事,必先利其器。为了搞清楚 Unity 的渲染顺序,首先我们要准备一个能方便修改 SortingLayer 以及 RenderQueue 的工具,下面这个编辑器脚本可以满足这个需求:

MeshRendererInspector.cs

效果如下:

阅读全文 »

Hello Readers, I’ll Show you how to make simple one way platform. It is simple, useful and efficient technique to achieve this result. Here is the procedure –

  1. Make a Simple platform using Box collider.
  2. Make a new game object children of the platform and add a box collider just below the original platform as shown in image and tick its ‘is trigger’ checkbox so that we can check player’s collision in it.

111

阅读全文 »

生成类

  • LevelGeneratorBase 最基本的生成方法类包括GenerateGenerateCoroutine
  • DungeonGeneratorBase 一般都会继承于该类

Generate流程

阅读全文 »

In object-oriented code bases, we tend to express most of not all of our data in highly semantic and contextual ways – that is, we use classes that contain both data and behaviour, and often even more information through inheritance, attributes, and more.

However, sometimes we need to extract the data contained in these types – for example for sending network messages, or saving to disk. In this post we will look into converting between structs and byte arrays, to make exactly this possible.

We will compare different ways of doing so, and analyse them for performance and easy of use.

阅读全文 »