コード例 #1
0
    public void Setup(IPuzzleData data)
    {
        _selectable  = GetComponent <SelectableBehaviour>();
        _graphicCtrl = GetComponent <PuzzleGraphic>();

        data = _data as PuzzleTrimmerData;
    }
コード例 #2
0
    public void Setup(IPuzzleData _data)
    {
        selectable  = GetComponent <SelectableBehaviour>();
        graphicCtrl = GetComponent <PuzzleGraphic>();

        //Choosing setups between the possibilities
        data = _data as PuzzlePressureData;

        //Setup Interactables
        Interactables.OutputMonitor.Setup(this, data.Monitor);
        Interactables.OutputMonitor.Toggle(false);

        Interactables.RedButton.Init(this, new ButtonData()
        {
            Type = ButtonType.Red
        });
        Interactables.BlueButton.Init(this, new ButtonData()
        {
            Type = ButtonType.Blue
        });
        Interactables.GreenButton.Init(this, new ButtonData()
        {
            Type = ButtonType.Green
        });

        Init();
    }
コード例 #3
0
    /// <summary>
    /// Sceglie, posiziona e inizializza i puzzle
    /// </summary>
    void CreateNewPuzzleSet()
    {
        int randIndex;
        List <Transform>   positionLeft = PuzzlePositions;
        List <IPuzzleData> _puzzleDatas = new List <IPuzzleData>();

        foreach (IPuzzleData item in PuzzleDatas)
        {
            //Creo il doppio delle copie di ogni puzzle data
            _puzzleDatas.Add(item);
            _puzzleDatas.Add(item);
        }

        for (int i = 0; i < Setting.TotalPuzzles; i++)
        {
            randIndex = Random.Range(0, _puzzleDatas.Count);
            IPuzzleData randData = _puzzleDatas[randIndex];

            int       randPos  = Random.Range(0, positionLeft.Count);
            Transform position = positionLeft[randPos];
            positionLeft.RemoveAt(randPos);

            IPuzzle randPuzzle = Instantiate(randData.GetIPuzzleGO(), position).GetComponent <IPuzzle>();
            randPuzzle.Setup(randData);
            randPuzzle.Init();
            puzzles.Add(randPuzzle);
            (randPuzzle as MonoBehaviour).GetComponent <SelectableBehaviour>().Init(selectable);
            _puzzleDatas.RemoveAt(randIndex);
        }

        foreach (Transform pos in positionLeft)
        {
            Instantiate(Setting.FillingObjects[Random.Range(0, Setting.FillingObjects.Count)], pos);
        }
    }
コード例 #4
0
    public void Setup(IPuzzleData _data)
    {
        selectable  = GetComponent <SelectableBehaviour>();
        graphicCtrl = GetComponent <PuzzleGraphic>();

        data = _data as PuzzleAutopilotData;
        GenerateInitialValues();
    }
コード例 #5
0
    public void Setup(IPuzzleData _data)
    {
        data = _data as PuzzleTurbineData;

        selectable = GetComponent <SelectableBehaviour>();

        graphicCtrl = GetComponent <PuzzleGraphic>();
        graphicCtrl.Init(graphicCtrl.Data);
    }
コード例 #6
0
    public void Setup(IPuzzleData _data)
    {
        data       = _data as PuzzleGPSData;
        selectable = GetComponent <SelectableBehaviour>();

        graphicCtrl = GetComponent <PuzzleGraphic>();

        GenerateRandomCombination();
    }
コード例 #7
0
    public void Setup(IPuzzleData _data)
    {
        selectable  = GetComponent <SelectableBehaviour>();
        graphicCtrl = GetComponent <PuzzleGraphic>();

        //Choosing a Setup between the possibilities
        data = _data as PuzzleALARM_Data;

        allButtons.Clear();
        allButtons.AddRange(ButtonsA);
        allButtons.AddRange(ButtonsB);
        allButtons.AddRange(ButtonsC);
        allButtons.AddRange(ButtonsD);
        allButtons.AddRange(ButtonsE);
        allButtons.AddRange(ButtonsF);
        allButtons.AddRange(ButtonsG);
        allButtons.AddRange(ButtonsH);
    }
コード例 #8
0
    public void Setup(IPuzzleData _data)
    {
        selectable  = GetComponent <SelectableBehaviour>();
        graphicCtrl = GetComponent <PuzzleGraphic>();

        data = _data as PuzzleClusterData;
        if (data.Sequences.Count < data.SequencesAmount)
        {
            Debug.LogError("ATTEZIONE: nel setup del PuzzleCluster non ci sono abbastanza sequenze possibili" +
                           "per sceglierne quante richiesto (SequenceAmount)!" +
                           "Valore cambiato via codice per funzionare (I DATI SONO STATI CAMBIATI)!");

            data.SequencesAmount = data.Sequences.Count;
        }

        Interactables.CheckBtn.Init(this, new ClusterButtonData()
        {
            BtnType = ClusterButton.Check
        });
        Interactables.A1_Btn.Init(this, new ClusterButtonData()
        {
            BtnType = ClusterButton.A1
        });
        Interactables.A2_Btn.Init(this, new ClusterButtonData()
        {
            BtnType = ClusterButton.A2
        });
        Interactables.A3_Btn.Init(this, new ClusterButtonData()
        {
            BtnType = ClusterButton.A3
        });
        Interactables.B4_Btn.Init(this, new ClusterButtonData()
        {
            BtnType = ClusterButton.B4
        });
        Interactables.B5_Btn.Init(this, new ClusterButtonData()
        {
            BtnType = ClusterButton.B5
        });
        Interactables.B6_Btn.Init(this, new ClusterButtonData()
        {
            BtnType = ClusterButton.B6
        });
    }
コード例 #9
0
    public void Setup(IPuzzleData _data)
    {
        selectable  = GetComponent <SelectableBehaviour>();
        graphicCtrl = GetComponent <PuzzleGraphic>();

        data = _data as PuzzleCablesData;

        GameObject fakeCable2 = new GameObject("FakeCable2");

        fakeCable2.transform.parent = transform;
        Components.Cables.Insert(1, fakeCable2);

        GameObject fakeCable6 = new GameObject("FakeCable2");

        fakeCable6.transform.parent = transform;
        Components.Cables.Insert(5, fakeCable6);

        lightOff_MatArr = new Material[] { Components.Lights[0].materials[0], LightOff_Mat };
        lightOn_MatArr  = new Material[] { Components.Lights[0].materials[0], LightOn_Mat };
    }
コード例 #10
0
    public void Setup(IPuzzleData _data)
    {
        selectable  = GetComponent <SelectableBehaviour>();
        graphicCtrl = GetComponent <PuzzleGraphic>();

        data = _data as PuzzleLockCodeData;

        Key1st.Init(this, new KeyData()
        {
            keyID = KeyOrder.Key1st
        });
        Key2nd.Init(this, new KeyData()
        {
            keyID = KeyOrder.Key2nd
        });
        Key3rd.Init(this, new KeyData()
        {
            keyID = KeyOrder.Key3rd
        });
    }