Exemplo n.º 1
0
    public void FullyLoad(List <PieceEvent> PieceEventsList)
    {
        //PieceEvents = new List<PieceEvent>();
        //PieceEvents.Add(ResourcesMaster.PieceEvents[0]);
        PieceEvents = new List <PieceEvent>();
        PieceEvents.AddRange(PieceEventsList);

        OngoingManagerEvent = PieceEvents[0];

        Index    = 0;
        MaxIndex = PieceEvents.Count - 1;

        foreach (PieceEvent PE in PieceEvents)
        {
            PE.FullyLoad();
        }

        Transform PanelsFather = transform.Find("Panels");

        foreach (PanelText Tuple in PieceEvents[0].Description)
        {
            TextManager TextManager = PanelsFather.Find(Tuple.PanelName).Find("Text").GetComponent <TextManager>();
            TextManager.ChangeText(Tuple.Text);
        }
        //GameObject.Find("Text").GetComponent<Text>().text = "aaaa" + PieceEvents[0];
    }
Exemplo n.º 2
0
 public void ActivateConfirmBox(string boxText, string worldNumber = "", string levelNumber = "")
 {
     SceneManagerScript.UpdatePause(true);
     _worldNumber = worldNumber;
     _levelNumber = levelNumber;
     _textBox.ChangeText(boxText);
     _panel.SetActive(true);
 }
Exemplo n.º 3
0
    protected void UpdateLives()
    {
        if (_livesText == null)
        {
            _livesText = GameObject.FindGameObjectWithTag("HUD_LivesText").GetComponent <TextManager>();
        }

        var livesRemaining = SceneManagerScript.RemainingLives;

        _livesText.ChangeText(livesRemaining.ToString());
    }
Exemplo n.º 4
0
 void SetStatus()
 {
     Debug.Log(button.gameObject.name + " was clicked");
     textManager.ChangeText(status);
 }
Exemplo n.º 5
0
    public void ManagerPlayEvent()
    {
        OngoingManagerEvent = PieceEvents[Index];
        Transform PanelsFather = transform.Find("Panels");

        foreach (PanelText Tuple in OngoingManagerEvent.Description)
        {
            Transform Panel = PanelsFather.Find(Tuple.PanelName);

            if (Panel == null)
            {
                Debug.LogError("Invalid Panel " + Tuple);
            }
            else
            {
                TextManager TextManager = Panel.Find("Text").GetComponent <TextManager>();
                if (TextManager == null)
                {
                    Debug.LogError("Invalid Panel Name " + Tuple);
                }
                else
                {
                    TextManager.ChangeText(Tuple.Text);
                }
            }
        }

        List <GameObject> Pieces = new List <GameObject>();

        string[] Subcomponents = OngoingManagerEvent.SubComponentNames.Split('/');
        foreach (string sub in Subcomponents)
        {
            GameObject Piece = transform.Find("Models").Find(OngoingManagerEvent.ComponentNames).Find(sub).GetChild(0).gameObject;
            if (Piece == null)
            {
                Debug.LogError("Invalid Components Name");
            }
            else
            {
                Pieces.Add(Piece);
            }
        }

        foreach (GameObject Piece in Pieces)
        {
            //TextManager.ChangeText(OngoingManagerEvent.Description);

            foreach (PieceAction PA in OngoingManagerEvent.PieceActions)
            {
                Debug.Log("Playing event " + OngoingManagerEvent.Name + " " + PA.Name + " " + PA.TranslationAmountVector + " " + PA.RotationAmountVector);

                if (Piece.GetComponent <Move>() == null && PA.TranslationAmountVector != Vector3.zero && float.Parse(PA.TranslationTime) > 0)
                {
                    Move MoveScript = Piece.AddComponent <Move>();
                    MoveScript.LoadEvent(PA.TranslationAmountVector, float.Parse(PA.TranslationTime));
                }
                if (Piece.GetComponent <Spin>() == null && PA.RotationAmountVector != Vector3.zero && float.Parse(PA.RotationTime) > 0)
                {
                    Spin SpinScript = Piece.AddComponent <Spin>();
                    SpinScript.LoadEvent(PA.RotationAmountVector, float.Parse(PA.RotationTime));
                }
            }
        }
    }