コード例 #1
0
ファイル: Dustbin.cs プロジェクト: mengtest/HackingSystem
 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;
     }
 }
コード例 #2
0
ファイル: Dustbin.cs プロジェクト: mengtest/HackingSystem
 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;
         }
     }
 }