Esempio n. 1
0
    /// <summary>
    /// Initializes and starts this state.
    /// </summary>
    /// <param name="_offset">Offset.</param>
    public void InitializeAndStartThisState(Vector3 _offset)
    {
        Vector3 offset = GameManager.Instance.gameMode.Player.position - cameraTransition.FocusTransform.position + _offset;

        cameraTransition.Reset(offset, Quaternion.LookRotation(-offset));
        startTime = Time.time + 2f;
        StartThisState();
    }
Esempio n. 2
0
    /// <summary>
    /// Starts this state.
    /// </summary>
    public override void StartThisState()
    {
        base.StartThisState();

        startTime = Time.time + 2f;

        stateOfTable = gameMode.StateOfTable;

        // gets the last state balls and positions
        Vector3[]   ballsPositions = stateOfTable.BallPositions;
        Transform[] balls          = gameMode.Balls;

        for (int i = 0; i < balls.Length; i++)
        {
            balls [i].position = ballsPositions [i];
        }

        Vector3 offset = stateOfTable.Cameraoffset;

        cameraTransition.Reset(offset, Quaternion.LookRotation(-offset));

        StartCoroutine(delayedShoot());
    }