Example #1
0
    public virtual void Update()
    {
        int previousPlayersActive = playersActive;

        playersActive = 0;
        //handle players gone missing
        for (int i = 0; i < max_PlayerNr; i++)
        {
            if (playerArray[i] != null)
            {
                playersActive++;
            }
        }
        if (previousPlayersActive != playersActive)
        {
            CheckPlayerNr();
        }

        //ROTATE Mode: 1 Player
        if (playersActive == 1 && state != ElementState.ROTATE && state != ElementState.DESTROY && !(this is Lens))
        {
            if (Time.time - timeEntered > logInTime)
            {
                Debug.Log("ROTATE Mode activated");
                Debug.Log("Player :" + playerArray[0] + " added.");
                ChangeState(ElementState.ROTATE);
                rotInt      = interactionManager.AddRotationInteraction(this, FindRotatingPlayer());
                timeEntered = 360000f; //TODO find a way to check time correctly
            }
        }
    }
 public virtual void Update()
 {
     //ROTATE Mode: 1 Player
     if (playerActive == 1 && state != ElementState.ROTATE && !(this is Lens))
     {
         if (Time.time - timeEntered > logInTime)
         {
             Debug.Log("ROTATE Mode activated");
             Debug.Log("Player :" + playerArray[0] + " added.");
             ChangeState(ElementState.ROTATE);
             interactionManager.AddRotationInteraction(this, playerArray[0]);
             timeEntered = 0;
         }
     }
 }