private void Start() {
     m_pinballLauncher = GetComponent<PinballLauncher>();
     foreach ( Rigidbody ball in m_initialBalls ) {
         m_pinballLauncher.AddBallToQueue( Instantiate( ball ) );
     }
     m_initialBalls = new Rigidbody[0];
 }
 private void OnEnable() {
     if ( !Application.isEditor ) {
         Destroy( this ); // Removes this script from the gameObject
         return;
     }
     m_pinballLauncher = GetComponent<PinballLauncher>();
 }
Пример #3
0
 private void OnEnable() {
     foreach ( PinballLauncher launcher in FindObjectsOfType<PinballLauncher>() ) {
         if ( launcher.tag == SRTags.Main_Ball_Launcher ) {
             PinballLauncher = launcher;
             break;
         }
     }
     m_text = GetComponent<Text>();
     if ( PinballLauncher != null ) {
         OnQueueChange( PinballLauncher.BallQueue );
     }
 }
Пример #4
0
 private void OnDisable() { PinballLauncher = null; }