Esempio 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;
    }
Esempio n. 2
0
    // Use this for initialization

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

        return(getPlayerPosition);
    }
Esempio n. 3
0
    //private GetCameraPosition cameraPosition;


    public override void Use()
    {
        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;
        base.Use();
        //Debug.Log(playerPosition.viewPoint.rotation.x);
        //Debug.Log( playerPosition.viewPoint.rotation.y );
        //Debug.Log( playerPosition.viewPoint.rotation.z );
        //StartCoroutine( ExecuteAfterTime( 10 ) );
        //Invoke( "DoSomething", 2 );
        RemoveFromInventory();
    }
Esempio n. 4
0
 private void Awake()
 {
     instance = this;
 }