Пример #1
0
    private void RollDiceOfPrefab(ref Vector3 position, ToolboxDice diceVars, ref int count, string prefab)
    {
        DiceWithCam dCam;

        for (int i = 0; i < diceVars.dsaDiceChosen[prefab]; i++)
        {
            //Erzeuge jeweils neue Kamera mit Würfel
            dCam        = new DiceWithCam(WürfelTyp.w20);
            position.y += count;

            SetParentGameObject(dCam);

            dCam.dice = PhotonNetwork.Instantiate(prefab, position, Quaternion.identity, 0);


            //Beschleunige und rotiere den Würfel
            RotateAndAccelerate(dCam.dice);

            //Positioniere die Kamera auf Würfel
            PositionCam(dCam);

            //füge den Würfel mit Kamera der UpdateListe hinzu
            createdDiceWithCam.Add(dCam);

            //Zähle aktuelle Wüfel nach oben
            countAllDice++;

            //aktueller counter
            count++;
        }
    }
Пример #2
0
    private void ModifyDSADiceChosen(bool activated, int numberDice, string prefabName)
    {
        ToolboxDice diceVar = ToolboxDice.Instance;

        if (activated)
        {
            diceVar.dsaDiceChosen[prefabName] = numberDice;
        }
    }
    private int GetNumberDice(ToolboxDice diceVars)
    {
        int numberDice = 0;

        foreach (var prefabName in diceVars.dsaDiceChosen.Keys)
        {
            numberDice += diceVars.dsaDiceChosen[prefabName];
        }
        return(numberDice);
    }
Пример #4
0
    private void SetDSADiceChosen(bool activated, int numberDice, string prefabName)
    {
        ToolboxDice diceVar = ToolboxDice.Instance;

        if (activated)
        {
            diceVar.dsaDiceChosen.Add(prefabName, numberDice);
        }
        else
        {
            diceVar.dsaDiceChosen.Remove(prefabName);
        }
    }
Пример #5
0
    private void InstantiateDice(Vector3 position)
    {
        ToolboxDice diceVars            = ToolboxDice.Instance;
        int         anzahlEigenschaften = diceVars.dsaDiceChosen.Count;
        int         count = 0;

        if (anzahlEigenschaften > 0)
        {
            CreateParentGameObject();
            foreach (var prefab in diceVars.dsaDiceChosen.Keys)
            {
                RollDiceOfPrefab(ref position, diceVars, ref count, prefab);
            }
        }
    }
 // Use this for initialization
 void Start()
 {
     diceVars   = ToolboxDice.Instance;
     mCharacter = diceVars.mCharacter;
     LoadEigenschaften();
 }
Пример #7
0
    public void Start()
    {
        ToolboxDice diceVar = ToolboxDice.Instance;

        diceVar.ColorDice = ToolboxDice.BLAU_STRING_OPTION;
    }
Пример #8
0
    public void SetNewColor()
    {
        ToolboxDice diceVar = ToolboxDice.Instance;

        diceVar.ColorDice = colorChooser.captionText.text;
    }
Пример #9
0
    override protected void InstantiateDice(WürfelTyp typ, Vector3 position, int anzahl)
    {
        ToolboxDice diceVars = ToolboxDice.Instance;

        if (anzahl > 0)
        {
            DiceWithCam dCam;
            CreateParentGameObject();

            for (int count = 0; count < anzahl; count++)
            {
                //Erzeuge jeweils neue Kamera mit Würfel
                dCam        = new DiceWithCam(typ);
                position.y += count;

                SetParentGameObject(dCam);

                switch (typ)
                {
                case WürfelTyp.w6:
                    if (count % 2 == 0)
                    {
                        dCam.dice = PhotonNetwork.Instantiate(diceVars.colorDice_d6, position, Quaternion.identity, 0);
                    }
                    else
                    {
                        dCam.dice = PhotonNetwork.Instantiate("d6black", position, Quaternion.identity, 0);
                    }

                    dCam.dice.name = "W6_" + count;
                    break;

                case WürfelTyp.w10:
                    if (count % 2 == 0)
                    {
                        dCam.dice = PhotonNetwork.Instantiate(diceVars.colorDice_d10, position, Quaternion.identity, 0);
                    }
                    else
                    {
                        dCam.dice = PhotonNetwork.Instantiate("d10black", position, Quaternion.identity, 0);
                    }
                    dCam.dice.name = "W10_" + count;
                    break;

                case WürfelTyp.w20:
                    if (count % 2 == 0)
                    {
                        dCam.dice = PhotonNetwork.Instantiate(diceVars.colorDice_d20, position, Quaternion.identity, 0);
                    }
                    else
                    {
                        dCam.dice = PhotonNetwork.Instantiate("d20black", position, Quaternion.identity, 0);
                    }
                    dCam.dice.name = "W20_" + count;
                    break;

                default:
                    break;
                }

                //Beschleunige und rotiere den Würfel
                RotateAndAccelerate(dCam.dice);

                //Positioniere die Kamera auf Würfel
                PositionCam(dCam);

                //füge den Würfel mit Kamera der UpdateListe hinzu
                createdDiceWithCam.Add(dCam);

                //Zähle aktuelle Wüfel nach oben
                countAllDice++;
            }
        }
    }
    private void Start()
    {
        ToolboxDice diceVars = ToolboxDice.Instance;

        dicePerThrow = GetNumberDice(diceVars);
    }