}//홀로그램 인식시 데이터 흡수

    void CNN_cam_place(GameObject target)
    {
        Module_Lable ML = target.GetComponent <Module_Lable>();

        if (machine_Obj_locating_target != null)
        {
            Circuit script_C = machine_Obj_locating_target.GetComponent <Circuit>();
            InteractiveObj_MultiTag script_I = machine_Obj_locating_target.GetComponent <InteractiveObj_MultiTag>();
            if ((script_C != null && script_C.signal_Type != 0) || (script_I != null && script_I.ObjType == InteractiveObj_MultiTag.AllType.Tower_Table))
            {
                //Instantiate(placing_Tower, aimed_circuit_position, machine_Obj_locating_target.transform.rotation);
                Connectec_Data_Obj.transform.position = aimed_circuit_position;
                Connectec_Data_Obj.transform.rotation = machine_Obj_locating_target.transform.rotation;
                target.SetActive(true);
                //Connectec_Data_Obj.GetComponent<function_CNN>().Classifier_Placed(machine_Obj_locating_target);
                Connectec_Data_Obj.SetActive(true);
                Connectec_Data_Obj.GetComponent <Tower_test>().Classifier_Placed(machine_Obj_locating_target);
                Connectec_Data_Obj.GetComponent <Machine_Effect>().Get_Signal(true);
                Connectec_Data_Obj = null;
                aim_Mark_obj.transform.position = Vector3.zero;
                module_Buffer = 0;
                Gun_Module_script.GetSignal(module_Buffer);
            }
        }//회로 위에 배치
        else if (ML != null)
        {
            if (ML.ModuleID % 100 == 0 && ML.Check_Module_Restrict(module_Buffer) == 1)
            {
                ML.GetSignal(module_Buffer);
                ML.Get_Machine_Signal(Connectec_Data_Obj);
                module_Buffer = 0;
                Gun_Module_script.GetSignal(module_Buffer);

                previous_script_ML = null;
                Connectec_Data_Obj = null;
            }
        } //모듈에 배치
    }     //회로위에 장치 배치 신호
    }     //회로위에 장치 배치 신호

    public void Module_buffer_return()
    {
        if (module_Buffer == 0)
        {
            Debug.Log("From player_shot 반환할 값이 없습니다");
        }
        else if (module_Buffer <= 30)
        {
            previous_script_ML.GetSignal(module_Buffer);
            module_Buffer = 0;
            Gun_Module_script.GetSignal(module_Buffer);
            previous_script_ML = null;
            Debug.Log("From player_shot 모듈 반환");
        }
        else if (module_Buffer <= 50)
        {
            if (previous_script_ML != null)
            {
                previous_script_ML.Get_Machine_Signal(Connectec_Data_Obj);
                previous_script_ML.GetSignal(module_Buffer);
            }
            else
            {
                Connectec_Data_Obj.SetActive(true);
            }

            Connectec_Data_Obj = null;

            module_Buffer = 0;
            Gun_Module_script.GetSignal(module_Buffer);
            previous_script_ML = null;
            Debug.Log("From player_shot 데이터 홀로그램 반환");
        }
        else if (module_Buffer < 90)
        {
            previous_script_ML.GetSignal(module_Buffer);

            module_Buffer = 0;
            Gun_Module_script.GetSignal(module_Buffer);
            previous_script_ML = null;
            Debug.Log("From player_shot 조립 홀로그램 반환");
        }
        else if (module_Buffer <= 99)
        {
            if (previous_script_ML != null)
            {
                previous_script_ML.GetSignal(module_Buffer);
                previous_script_ML.Get_Machine_Signal(Connectec_Data_Obj);
            }
            else
            {
                Connectec_Data_Obj.SetActive(true);
                Connectec_Data_Obj.GetComponent <Tower_test>().Classifier_Placed(Connectec_Data_Obj.GetComponent <Tower_test>().circuit_Obj);
                Connectec_Data_Obj.GetComponent <Machine_Effect>().Get_Signal(true);
                aim_Mark_obj.transform.position = Vector3.zero;
            }

            Connectec_Data_Obj = null;

            module_Buffer = 0;
            Gun_Module_script.GetSignal(module_Buffer);
            previous_script_ML = null;
            Debug.Log("From player_shot 타워 반환");
        }
    }//데이터 복귀시키기
    }//조준점 근처 회로 인식

    public void module_InOut(GameObject target)
    {
        Module_Lable         ML  = target.GetComponent <Module_Lable>();
        Puzzle_Part_Hologram PPH = target.GetComponent <Puzzle_Part_Hologram>();
        Tower_test           TT  = target.GetComponent <Tower_test>();
        Data_Hologram        DT  = target.GetComponent <Data_Hologram>();
        Machine_Effect       ME  = target.GetComponent <Machine_Effect>();


        if (ML != null)//모듈 조준
        {
            if (module_Buffer == 0 && ML.ModuleID % 100 != 0 && ML.Check_Module_Restrict(module_Buffer) == 1)
            {
                module_Buffer = ML.ModuleID % 100;
                ML.GetSignal(0);
                Gun_Module_script.GetSignal(module_Buffer);

                Connectec_Data_Obj        = ML.Connected_Func_machine; // 머신 전용
                ML.Connected_Func_machine = null;                      // 머신 전용
                if (module_Buffer == 90)
                {
                    aim_Mark_obj = Hologram_Marker[0];
                }
                else if (module_Buffer == 91)
                {
                    aim_Mark_obj = Hologram_Marker[1];
                }
                previous_script_ML = ML;
            }
            else if (module_Buffer != 0 && ML.ModuleID % 100 == 0 && ML.Check_Module_Restrict(module_Buffer) == 1)
            {
                ML.Get_Machine_Signal(Connectec_Data_Obj);
                ML.GetSignal(module_Buffer);
                module_Buffer      = 0;
                Connectec_Data_Obj = null;
                Gun_Module_script.GetSignal(module_Buffer);
                previous_script_ML = null;
            }
            else if (ML.Check_Module_Restrict(module_Buffer) == 2)
            {
                ML.Get_Restricted_Module_Signal(module_Buffer);
                module_Buffer = 0;
                Gun_Module_script.GetSignal(module_Buffer);
                previous_script_ML = null;
            }
            else if (ML.Check_Module_Restrict(module_Buffer) == 3)
            {
                module_Buffer = ML.ModuleID % 100;
                ML.Get_Restricted_Module_Signal(0);
                Gun_Module_script.GetSignal(module_Buffer);
                previous_script_ML = ML;
            }
            Debug.Log("From 'player_shot' GunBuffer : " + module_Buffer + " targetModule_Buffer : " + ML.ModuleID);
        }//모듈 조준
        else if (PPH != null)
        {
            if (module_Buffer == 0 && PPH.hologram_Part_ID != 0 && PPH.module_Linked.GetComponent <Module_Lable>().Check_Module_Restrict(module_Buffer) != 0)
            {
                //Debug.Log("From 'player_shot' DisAssemble");
                module_Buffer      = PPH.Get_Disassemble_Signal();
                previous_script_ML = PPH.module_Linked.GetComponent <Module_Lable>();

                Gun_Module_script.GetSignal(module_Buffer);
            } //홀로그램 분해
        }     //퍼즐 홀로그램 조준
        else if (TT != null && ME != null)
        {
            if (module_Buffer == 0)
            {
                //Debug.Log("From player_shot Get Cnn_machine");
                if (TT.TowerFunc == Tower_test.TowerStyle.CNN)
                {
                    module_Buffer = 90;
                    aim_Mark_obj  = Hologram_Marker[0];
                }
                else if (TT.TowerFunc == Tower_test.TowerStyle.Electric)
                {
                    module_Buffer = 91;
                    aim_Mark_obj  = Hologram_Marker[1];
                }
                Connectec_Data_Obj = target;
                target.SendMessage("Get_Consume_Signal");
                target.GetComponent <Machine_Effect>().Get_Signal(false);

                Gun_Module_script.GetSignal(module_Buffer);
                previous_script_ML = null;
            }
        }//인식기 조준
        else if (DT != null && Test_DT_Identify)
        {
            if (module_Buffer == 0)
            {
                //Destroy(target);
                module_Buffer = DT.moduleID;

                Connectec_Data_Obj = target;
                target.SendMessage("Get_Consume_Signal");

                Gun_Module_script.GetSignal(module_Buffer);
            }
        }
    }//데이터 전송 & 흡수
Beispiel #4
0
    private int Target_Distinguishing(GameObject target)
    {
        int                  ui_Num = 0; // 0 : none, 1 : Data Get, 2 : Data Transfer, 3 : Get Machine, 4 : Machine Shoot, 5 : Machine Shoot & Data Get, 6 : Machine Set on Circuit, 7 : Data Hologram Identify, 8 : Drawing Panel, 9 : Circuit_Drawing, 10 : Timer
        Module_Lable         ML     = target.GetComponent <Module_Lable>();
        Puzzle_Part_Hologram PPH    = target.GetComponent <Puzzle_Part_Hologram>();
        Tower_test           TT     = target.GetComponent <Tower_test>();
        Data_Hologram        DT     = target.GetComponent <Data_Hologram>();
        Drawing              Draw   = target.GetComponent <Drawing>();
        Puzzle_Drawing       p_Draw = target.GetComponent <Puzzle_Drawing>();
        Timer                Tm     = target.GetComponent <Timer>();

        if (ML != null)
        {
            if (gun_Data_Buffer == 0 && ML.ModuleID % 100 != 0 && ML.Check_Module_Restrict(gun_Data_Buffer) == 1)
            {
                ui_Num = 1;
            }
            else if (gun_Data_Buffer != 0 && ML.ModuleID % 100 == 0 && ML.Check_Module_Restrict(gun_Data_Buffer) == 1)
            {
                ui_Num = 2;
            }
            else if (ML.Check_Module_Restrict(gun_Data_Buffer) == 2)
            {
                ui_Num = 2;
            }
        }
        else if (Tm != null)
        {
            ui_Num = 10;
        }
        else if (PPH != null)
        {
            if (gun_Data_Buffer == 0 && PPH.hologram_Part_ID != 0 && PPH.module_Linked.GetComponent <Module_Lable>().Check_Module_Restrict(gun_Data_Buffer) != 0)
            {
                ui_Num = 1;
            } //홀로그램 분해
        }     //퍼즐 홀로그램 조준
        else if (TT != null)
        {
            if (TT.TowerFunc == Tower_test.TowerStyle.Button_Sig1 || TT.TowerFunc == Tower_test.TowerStyle.Button_Sig2 || TT.TowerFunc == Tower_test.TowerStyle.Button_Sig3)
            {
                ui_Num = 11;
            }

            if (gun_Data_Buffer == 0)
            {
                //Debug.Log("From player_shot Get Cnn_machine");
                if (TT.TowerFunc == Tower_test.TowerStyle.CNN)
                {
                    if (TT.Circuit_On)
                    {
                        ui_Num = 5;
                    }
                    else
                    {
                        ui_Num = 3;
                    }
                }
                else if (TT.TowerFunc == Tower_test.TowerStyle.Electric)
                {
                    if (TT.Circuit_On)
                    {
                        ui_Num = 5;
                    }
                    else
                    {
                        ui_Num = 3;
                    }
                }
            }
            else
            {
                if (TT.TowerFunc == Tower_test.TowerStyle.CNN)
                {
                    if (TT.Circuit_On)
                    {
                        ui_Num = 4;
                    }
                    else
                    {
                        ui_Num = 0;
                    }
                }
                else if (TT.TowerFunc == Tower_test.TowerStyle.Electric)
                {
                    if (TT.Circuit_On)
                    {
                        ui_Num = 4;
                    }
                    else
                    {
                        ui_Num = 0;
                    }
                }
            }
        }//인식기 조준
        else if (DT != null)
        {
            if (ray_Hit_Obj.distance < 10)
            {
                ui_Num = 7;
            }
        }
        else if (Draw != null)
        {
            ui_Num = 8;
        }
        else if (p_Draw != null)
        {
            ui_Num = 9;
        }
        else
        {
            if (Machine_Circuit_Check)
            {
                ui_Num = 6;
            }
            else
            {
                ui_Num = 0;
            }
        }
        return(ui_Num);
    }