Inheritance: MonoBehaviour
Exemple #1
0
    //private float rollSpeed;

    //private float offSetX;

    // Use this for initialization
    void Start()
    {
        startPos  = transform.position;
        startRot  = transform.rotation.eulerAngles;
        rigidBody = GetComponent <Rigidbody> ();
        // Caculate rotation
        //rollSpeed = launchSpeed / (2*ballRadius*3.14f) * -360f;
        rollingSound = GetComponent <AudioSource> ();
        //rigidBody.useGravity = false;

        if (GameObject.FindObjectOfType <DragLaunch> ())
        {
            dragLaunch = GameObject.FindObjectOfType <DragLaunch> ();
        }
        else
        {
            Debug.LogWarning("DragLaunch is missing");
        }
        //SetMouseXOffest ();

        //TODO Test code delete after complete.
        if (testDelay > 0)
        {
            Invoke("Test", testDelay);
        }
    }
 private void Start()
 {
     ball         = FindObjectOfType <Ball>();       //找球
     dragLaunch   = FindObjectOfType <DragLaunch>(); //找發射板
     pinSetter    = FindObjectOfType <PinSetter>();
     scoreDisplay = FindObjectOfType <ScoreDisplay>();
 }
Exemple #3
0
 // Use this for initialization
 void Start()
 {
     rigidbody            = GetComponent <Rigidbody> ();
     audioSource          = GetComponent <AudioSource> ();
     rigidbody.useGravity = false;
     startPoint           = transform.position;
     isLaunched           = GameObject.FindObjectOfType <DragLaunch> ();
 }
Exemple #4
0
    void Start()
    {
        rigidBody  = GetComponent <Rigidbody>();
        dragLaunch = GetComponent <DragLaunch>();

        rigidBody.useGravity = false;

        startPosition = transform.position;

        inPlay = true;
    }
Exemple #5
0
 private void Start()
 {
     pinSetter     = GameObject.FindObjectOfType <PinSetter>();
     pinCounter    = GameObject.FindObjectOfType <PinCounter>();
     ball          = GameObject.FindObjectOfType <Ball>();
     dragLaunch    = GameObject.FindObjectOfType <DragLaunch>();
     scoreDisplay  = GameObject.FindObjectOfType <ScoreDisplay>();
     gameOverPanel = GameObject.Find("GameOverPanel");
     gameOverPanel.SetActive(false);
     playerName      = PlayerNameController.playerName;
     playerText.text = playerName;
 }