if(Input.GetKeyDown(KeyCode.Keypad0))
if (Input.GetMouseButtonDown(0))
if (Input.GetAxis("Mouse X") > 0)
RaycastHit hit;
var layerMask = 1 << 8;
if (Physics.Raycast(ray, out hit, 1000 /*,layerMask*/))
{
Debug.DrawLine(ray.origin, hit.point);
if (hit.transform.name == "add")
transform.Translate( new Vector3(-CommonConstBattle.enemySpeedRun * Time.deltaTime ,0,0),Space.World);
gameObject.AddComponent("FoobarScript");
sc = gameObject.AddComponent("SphereCollider") as SphereCollider;
animator.SetFloat("***",0.1f);
void Awake () { mInstance = this; }
void OnDestroy () { mInstance = null; }
public delegate void timebar_delegate();
public static event timebar_delegate time_bar_end_make_gold;
在代码中调用time_bar_end_make_gold()
提供cleanDelegate(){
time_bar_end_make_gold=null;
}
//***********************接收
cleanDelegate()
timer_bar_control.time_bar_end_upgrade_iron+=upgrade_finish;
//收到消息后跳转到函数
upgrade_finish(){
........
}