Ejemplo n.º 1
0
    /// <summary>
    /// Simulate the path of a launched ball.
    /// Slight errors are inherent in the numerical method used.
    /// </summary>
    ///
    void simulatePath()
    {
        playerPosition = GetPlayerPosition.Instance();
        cameraPosition = GetCameraPosition.Instance();
        var launchedJewel = Instantiate(jewelModel, playerPosition.rightArmTRansform.position, playerPosition.transform.rotation * Quaternion.Euler(-45, 0, 0));

        launchedJewel.GetComponent <Rigidbody>().velocity = launchedJewel.transform.forward * launchSpeed;
    }
Ejemplo n.º 2
0
    // Use this for initialization

    public static GetCameraPosition Instance()
    {
        if (!getCameraPosition)
        {
            getCameraPosition = FindObjectOfType(typeof(GetCameraPosition)) as GetCameraPosition;
            if (!getCameraPosition)
            {
                Debug.LogError("There needs to be one active GetPlayerPosition script on a GameObject in your scene.");
            }
        }

        return(getCameraPosition);
    }
Ejemplo n.º 3
0
 private void Awake()
 {
     instance = this;
 }