Exemple #1
0
    public void ReturnHighLightTile(HologramObject holo)
    {
        holo.tilePos.x = -1;
        holo.tilePos.y = -1;
        holo.gameObject.transform.parent = this.transform;
        holo.gameObject.SetActive(false);

        m_highLightTileCache.ReturnObject(holo);
    }
    }//데이터 전송 & 흡수

    public void Get_Hologram_Data(GameObject target)
    {
        HologramObject DT = target.GetComponent <HologramObject>();

        if (DT != null)
        {
            target.SendMessage("OnTransferToPlayer");
            if (module_Buffer == 0)
            {
                //Destroy(target);
                module_Buffer      = DT.ID;
                Connectec_Data_Obj = target.GetComponent <MagneticMachine>();

                Gun_Module_script.GetSignal(module_Buffer);
            }
            else
            {
                target.SendMessageUpwards("Get_Exception_Signal", target);
            }
        }
    }//홀로그램 인식시 데이터 흡수
Exemple #3
0
    private void BuildSelectedHolograms()
    {
        for (int i = 0; i < m_selectedTiles.Count; i++)
        {
            Color tileColor = new Color(0.94f, 0.87f, 0f, 0.9f);
            int   index     = m_associatedGroundData.ConvertVec2IntToInt(m_selectedTiles[i]);
            if (m_associatedGroundData.m_groundTiles[index] != 0)
            {
                tileColor = new Color(1f, 0f, 0f, 0.9f);
            }

            HologramObject holo = CacheManager.Singleton.RequestHighLightTile();
            holo.tilePos.x = m_selectedTiles[i].x;
            holo.tilePos.y = m_selectedTiles[i].y;

            holo.gameObject.transform.position = new Vector3(holo.tilePos.x, 0f, holo.tilePos.y);
            holo.gameObject.SetActive(true);
            holo.SetColor(tileColor);

            m_selectedHolograms.Add(holo);
        }
    }
    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
        TransferableDataObject ML  = target.GetComponent <TransferableDataObject>();
        Puzzle_Part_Hologram   PPH = target.GetComponent <Puzzle_Part_Hologram>();
        MagneticMachine        TT  = target.GetComponent <MagneticMachine>();
        HologramObject         DT  = target.GetComponent <HologramObject>();
        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.ID % 100 != 0 && ML.IsTransferPossible)
            {
                ui_Num = 1;
            }
            else if (gun_Data_Buffer != 0 && ML.ID % 100 == 0 && ML.IsTransferPossible)
            {
                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 <TransferableDataObject>().IsTransferPossible)
            {
                ui_Num = 1;
            } //홀로그램 분해
        }     //퍼즐 홀로그램 조준
        else if (TT != null)
        {
            if (TT.TowerFunc == MagneticMachine.TowerStyle.Button_Sig1 || TT.TowerFunc == MagneticMachine.TowerStyle.Button_Sig2 || TT.TowerFunc == MagneticMachine.TowerStyle.Button_Sig3)
            {
                ui_Num = 11;
            }

            if (gun_Data_Buffer == 0)
            {
                //Debug.Log("From player_shot Get Cnn_machine");
                if (TT.TowerFunc == MagneticMachine.TowerStyle.CNN)
                {
                    if (TT.Circuit_On)
                    {
                        ui_Num = 5;
                    }
                    else
                    {
                        ui_Num = 3;
                    }
                }
                else if (TT.TowerFunc == MagneticMachine.TowerStyle.Electric)
                {
                    if (TT.Circuit_On)
                    {
                        ui_Num = 5;
                    }
                    else
                    {
                        ui_Num = 3;
                    }
                }
            }
            else
            {
                if (TT.TowerFunc == MagneticMachine.TowerStyle.CNN)
                {
                    if (TT.Circuit_On)
                    {
                        ui_Num = 4;
                    }
                    else
                    {
                        ui_Num = 0;
                    }
                }
                else if (TT.TowerFunc == MagneticMachine.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);
    }
    }//조준점 근처 회로 인식

    public void module_InOut(GameObject target)
    {
        TransferableDataObject ML              = target.GetComponent <TransferableDataObject>();
        Puzzle_Part_Hologram   PPH             = target.GetComponent <Puzzle_Part_Hologram>();
        MagneticMachine        magneticMachine = target.GetComponent <MagneticMachine>();
        HologramObject         DT              = target.GetComponent <HologramObject>();
        Machine_Effect         ME              = target.GetComponent <Machine_Effect>();


        if (ML != null)//모듈 조준
        {
            if (module_Buffer == 0 && ML.ID % 100 != 0 && ML.IsTransferPossible)
            {
                module_Buffer = ML.ID % 100;
                ML.OnDataTransfer(0);
                Gun_Module_script.GetSignal(module_Buffer);

                Connectec_Data_Obj = ML.ConnectedMachine; // 머신 전용
                ML.DetachConnectedMachine();              // 머신 전용
                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.ID % 100 == 0 && ML.IsTransferPossible)
            {
                ML.OnMachineDataTransfer(Connectec_Data_Obj);
                ML.OnDataTransfer(module_Buffer);
                module_Buffer      = 0;
                Connectec_Data_Obj = null;
                Gun_Module_script.GetSignal(module_Buffer);
                previous_script_ML = null;
            }
        }//모듈 조준
        else if (PPH != null)
        {
            if (module_Buffer == 0 && PPH.hologram_Part_ID != 0 && PPH.module_Linked.GetComponent <TransferableDataObject>().IsTransferPossible)
            {
                //Debug.Log("From 'player_shot' DisAssemble");
                module_Buffer      = PPH.Get_Disassemble_Signal();
                previous_script_ML = PPH.module_Linked.GetComponent <TransferableDataObject>();

                Gun_Module_script.GetSignal(module_Buffer);
            } //홀로그램 분해
        }     //퍼즐 홀로그램 조준
        else if (magneticMachine != null && ME != null)
        {
            if (module_Buffer == 0)
            {
                //Debug.Log("From player_shot Get Cnn_machine");
                if (magneticMachine.TowerFunc == MagneticMachine.TowerStyle.CNN)
                {
                    module_Buffer = 90;
                    aim_Mark_obj  = Hologram_Marker[0];
                }
                else if (magneticMachine.TowerFunc == MagneticMachine.TowerStyle.Electric)
                {
                    module_Buffer = 91;
                    aim_Mark_obj  = Hologram_Marker[1];
                }
                Connectec_Data_Obj = magneticMachine;
                target.SendMessage("OnTransferToPlayer");
                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.ID;

                Connectec_Data_Obj = magneticMachine;
                target.SendMessage("OnTransferToPlayer");

                Gun_Module_script.GetSignal(module_Buffer);
            }
        }
    }//데이터 전송 & 흡수