예제 #1
0
 public void checkElementStatus(Element element)
 {
     var e=element;
     element.status="qk";
     if(element.container&&element.container.name!="QK")element.status="broken";
     int ll=Mathf.Min(elementOrderList.Length,containerOrderList.Length);
     for(int i=0;i<ll;i++){
     e=elementOrderList[i];
     if(e==element&&e==containerOrderList[i].element)e.status="work";
     }
     e=element;
     switch(e.status){
     case"work":
     // isLocked=true;
     // e.OnWork();
     if(targetFSM)targetFSM.SendEvent("item_"+e.name[0]+"_work");
     if(e.workActivate)e.workActivate.SetActive(true);
     if(e.brokenActivate)e.brokenActivate.SetActive(false);
     e.collider.enabled=false;
     // Destroy(e.collider);
     break;
     case"broken":
     if(targetFSM)targetFSM.SendEvent("item_"+e.name[0]+"_broken");
     if(e.workActivate)e.workActivate.SetActive(false);
     if(e.brokenActivate)e.brokenActivate.SetActive(true);
     break;
     default:
     if(e.workActivate)e.workActivate.SetActive(false);
     if(e.brokenActivate)e.brokenActivate.SetActive(false);
     // e.tra.localScale=e.scaleDock*Vector3.one;
     break;
     }
 }
예제 #2
0
 void putItem()
 {
     element.pos=element.container.pos;
     element.container.element=element;
     element.container.collider.enabled=false;
     element.container.gameObject.SetActive(false);
     element.collider.enabled=true;
     element.status="put";
     checkElementStatus(element);
     toggleEleCollider(true);
     element=null;
 }
예제 #3
0
 void piciItem(Element e)
 {
     if(e.container){
     e.container.element=null;
     e.container.collider.enabled=true;
     e.container.gameObject.SetActive(true);
     }
     e.collider.enabled=false;
     element=e;
     toggleEleCollider(false);
 }