0%

2018-2019版本升级后报错:Timeline.dll miss

pakegerMnager -> Install Timeline

.asmdef –> Add dll

Next主题已经更新至6.X版本,不蒜子统计插件配置

1
2
3
4
5
6
7
8
9
10
文件:主题配置文件_config.ymlcopy# Show Views/Visitors of the website/page with busuanzi.
# Get more information on http://ibruce.info/2015/04/04/busuanzi/
busuanzi_count:
enable: true
total_visitors: true
total_visitors_icon: user
total_views: true
total_views_icon: eye
post_views: false
post_views_icon: eye
阅读全文 »

静态类

不能实例化,不能被继承(自带sealed)。

特征

1.仅包含静态成员

2.无法实例化

3.不能被继承

4.只能包含静态构造函数

静态方法

静态构造

静态变量

初始化时机

*abstract *

可以包含抽象方法(没办法抽象方法只能放在抽象类中),其他所包含的成员跟类一样。

特性介于类和接口之间。

1.安装 node.js 并终端输入

npm install -g asar
1
sudo npm install -g asar

2.打开访达,在应用程序中找到Unity Hub,然后打开显示包内容,然后依次进入Contents ——> Resources

阅读全文 »

this的意义

代表类实例化后的对象。所以不能声明为static索引器。

其他

允许重载,可多参。

作用

补1.数据过滤下标异常

接口中只能包含方法、属性、事件和索引的组合。

1
2
3
4
5
6
7
8
public interface IWorker {
void Ork(string s); // 方法
int Orop {get; } // 属性
event Action Oract; // 事件
int this[int index] { // 索引器
get;
}
}
阅读全文 »

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System;
using UnityEngine;
[RequireComponent(typeof(SpriteRenderer))]
public class SpriteShadow : MonoBehaviour{
[HideInInspector]
public Vector2 offset;
public float offsetX;
public float offsetY;
private SpriteRenderer sprRndCaster;
private SpriteRenderer sprRndShadow;
private Transform transCaster;
private Transform transShadow;
[HideInInspector]
public Material ShadowMaterial;
[Tooltip("Order in Layer")]
//public int sortingOrder;
public int sortingOrderDifference;

//public int sortingOrderDifference;
//public bool updateSpriteOverTime = true;
public bool updatePositionOverTime = true;
private void Start(){
this.offset = new Vector2(this.offsetX, this.offsetY);
this.transCaster = this.transform;
this.transShadow = new GameObject().transform;
this.transShadow.parent = this.transCaster;
this.transShadow.gameObject.name = "Shadow";
this.transShadow.localRotation = Quaternion.identity;
var vector = Vector3.one;
var parent = this.transShadow;
while (parent != null){
//vector.Multiply(parent.localScale); // 放大 x * x, y * y
parent = parent.parent;
}
this.transShadow.localScale = vector;
this.sprRndCaster = this.GetComponent<SpriteRenderer>();
this.sprRndShadow = this.transShadow.gameObject.AddComponent<SpriteRenderer>();
//this.sprRndShadow.material = this.ShadowMaterial;
this.sprRndShadow.material = this.sprRndCaster.material;
//HHLogger.DEBUG(this.ShadowMaterial, this.sprRndCaster.material);
this.sprRndShadow.material.color = new Color(1,1,1,0.35f);
//this.sprRndShadow.color = Color.white;
this.sprRndShadow.color = Color.black;
this.sprRndShadow.sortingLayerName = this.sprRndCaster.sortingLayerName;
this.sprRndShadow.sortingOrder = this.sprRndCaster.sortingOrder + this.sortingOrderDifference - 1;
this.transShadow.position = new Vector2(this.transCaster.position.x + this.offset.x, this.transCaster.position.y + this.offset.y);
//this.transShadow.localPosition = new Vector3(this.offset.x, this.offset.y, 0);
this.sprRndShadow.sprite = this.sprRndCaster.sprite;
this.sprRndShadow.flipX = this.sprRndCaster.flipX;
}

private void LateUpdate()
{
//if (this.updateSpriteOverTime){
// this.sprRndShadow.sprite = this.sprRndCaster.sprite;
// this.sprRndShadow.flipX = this.sprRndCaster.flipX;
//}
if (this.updatePositionOverTime)
{
this.transShadow.position = new Vector2(this.transCaster.position.x + this.offset.x, this.transCaster.position.y + this.offset.y);
}
}
}