在StickController.cs中
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class StickController : MonoBehaviour {
public GameObject whiteBall;
public GameObject tableStick;
public GameObject whiteBallParticleSystem;
private WhiteBallParticleSystemController whiteBallParticleSystemController;
private Vector3 whiteBallOffsetTableStick;
public Vector3 hitVector;
public GameObject hitPowerGameObject;
private Slider hitPower;
public GameObject sceneManagerObject;
private SceneManager sceneManager;
private Rigidbody tableStickRigidBody;
private Rigidbody whiteBallRigidBody;
private Quaternion oldTableStickRotation;
//system configure
private float tableStickRotationSpeed = 50.0f;
private float hitSpeed = 80.0f;
private bool startSlider = false; //空格下上控制状态
private bool leftToRight = true;
private Vector3 tempHitVector;
public bool ifHitReady;
// Use this