/// <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; }
// 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); }
private void Awake() { instance = this; }