public override void InActive() { if (Control.SubWPAttackRDown() && state == TopState.Running) { GameObject.Destroy(CurModel.GetComponent <ModelActionRun>()); GameObject.Destroy(CurModel.transform.GetChild(0).GetComponent <ColliderJudgeRun>()); ModelActionBK bk = CurModel.AddComponent <ModelActionBK>(); ColliderJudgeBK bkj = CurModel.transform.GetChild(0).gameObject.AddComponent <ColliderJudgeBK>(); bkj.owner = this; bk.owner = this; } }
private void Update() { if (GameSystem.paused) { GetComponent <Rigidbody>().velocity = Vector3.zero; } else { time += Time.deltaTime; if (time >= 2) { //时间超出直接收回 ModelActionBK bk = gameObject.AddComponent <ModelActionBK>(); ColliderJudgeBK bkj = transform.GetChild(0).gameObject.AddComponent <ColliderJudgeBK>(); bkj.owner = owner; bk.owner = owner; Destroy(this); Destroy(transform.GetChild(0).GetComponent <ColliderJudgeRun>()); owner.state = TopState.Backing; } } }