Beispiel #1
0
 private void Awake()
 {
     ballLauncher       = GetComponent <BallLauncher>();
     mainCamera         = Camera.main;
     levelManager       = FindObjectOfType <LevelManager>();
     trajectoryRenderer = GetComponent <TrajectoryRenderer>();
 }
Beispiel #2
0
 void Start()
 {
     myBallLauncher = GameObject.Find("BowlingBall").GetComponent <BallLauncher> ();
     myAdjustSign   = GameObject.Find("AdjustSign");
     myArrowSign    = GameObject.Find("ArrowSign");
     myPowerBar     = GameObject.Find("PowerBar");
 }
Beispiel #3
0
    private void Awake()
    {
        rigidBody2D = GetComponent <Rigidbody2D>();
        renderer    = GetComponent <SpriteRenderer>();

        ballLauncher = FindObjectOfType <BallLauncher>();
    }
Beispiel #4
0
 public static void NullReferences()
 {
     _gameManager  = null;
     _uimanager    = null;
     _blockManager = null;
     _ballLauncher = null;
 }
Beispiel #5
0
 // Use this for initialization
 void Start()
 {
     text         = GetComponent <Text>();
     ballLauncher = FindObjectOfType <BallLauncher>();
     crosshair    = FindObjectOfType <Crosshair>();
     crosshair.setSize(10);
     text.text = "";
 }
Beispiel #6
0
 void Start()
 {
     audio        = GameObject.Find("Managers").GetComponent <AudioSource> ();
     controller   = GameObject.Find("Managers").GetComponent <BallLauncher> ();
     batRigidBody = this.gameObject.GetComponent <Rigidbody> ();
     vm           = GameObject.Find("Managers").GetComponent <VariableManager> ();
     tm           = GameObject.Find("Managers").GetComponent <TextManager> ();
 }
    // Use this for initialization
    void Start()
    {
        GameObject bL = GameObject.Find("BallLauncher");

        if (bL != null)
        {
            bLauncher = bL.GetComponent <BallLauncher>();
        }
    }
Beispiel #8
0
 void Start()
 {
     myBowlingBall       = GameObject.Find("BowlingBall");
     myBallLauncher      = myBowlingBall.GetComponent <BallLauncher> ();
     cameraFollowOffset  = new Vector3(-6.5f, 5.5f, -14f);
     cameraAngleTo       = new Vector3(15f, 22.5f, 0f);
     cameraFieldOfViewTo = 30;
     isCameraFollowing   = false;
 }
Beispiel #9
0
 void Start()
 {
     ballLauncher  = GameObject.FindGameObjectWithTag("Launcher");
     bl            = ballLauncher.GetComponentInChildren <BallLauncher>();
     manager       = GameObject.FindGameObjectWithTag("GameController");
     managerScript = manager.GetComponent <LevelManager>();
     tubeObject    = GameObject.FindGameObjectWithTag("Tube");
     tube          = tubeObject.GetComponent <Tube>();
     rg            = gameObject.GetComponent <Rigidbody>();
 }
    private void Awake()
    {
        Instance       = this;
        m_CanPlay      = true;
        m_LineRenderer = GetComponent <LineRenderer>();

        m_DefaultStartPosition = transform.position;

        m_BallsAmount = PlayerPrefs.GetInt("balls", 1);
    }
Beispiel #11
0
    private void Awake()
    {
        STF.NullReferences();
        balllauncher = STF.ballLauncher;
        blockmanager = STF.blockManager;
        uimanager    = STF.uimanager;

        _timeToIncreaseTimeScale = timeToIncreaseTimeScale;
        _timeToTurnOnGravity     = timeToTurnOnGravity;
        gameState = GameState.aiming;
    }
 private void Awake()
 {
     if (instance != null)
     {
         Destroy(gameObject);
     }
     else
     {
         instance = this;
     }
 }
    private void Awake()
    {
        m_launcher   = GetComponentInChildren <BallLauncher>();
        m_controller = GetComponent <CharacterController>();
        m_anim       = gameObject.GetComponentInChildren <Animator>();

        throwBallTriggerHash = Animator.StringToHash("ThrowBall");
        isRunningBoolHash    = Animator.StringToHash("IsRunning");
        isStrafingBoolHash   = Animator.StringToHash("IsStrafing");
        runBackwardsBoolHash = Animator.StringToHash("RunBackwards");

        startPosition = transform.position;
        startRotation = transform.rotation;

        currentTick = 0;
    }
    private void OnTriggerEnter(Collider other)
    {
        launcherDoor.setState(true);
        GameObject ball = other.gameObject;

        //mover al bola al punto de spaw
        ball.transform.position = spawBallPosition.position;
        ball.transform.rotation = spawBallPosition.rotation;

        //poner a cero las velocidades del rigibody
        Rigidbody rb = ball.GetComponent <Rigidbody>();

        rb.velocity        = Vector3.zero;
        rb.angularVelocity = Vector3.zero;

        //Acceder al componente Bal Launcher del bola y la varieable fired ponerla a false
        BallLauncher launcher = ball.GetComponent <BallLauncher>();

        launcher.fired = false;
        GameObject.FindObjectOfType <ScoreManager>().ResetScore();
    }
Beispiel #15
0
 public void OnGazeEnter()
 {
     if (!isInPlay)
     {
         if (ballLauncher != null)
         {
             ballLauncher.GrabBall();
         }
         else
         {
             ballLauncher = FindObjectOfType <BallLauncher> ();
             if (ballLauncher != null)
             {
                 ballLauncher.GrabBall();
             }
             else if (ballLauncher == null)
             {
                 Debug.LogWarning("Weird shit happened to the Ball Launcher o.O");
             }
         }
     }
 }
Beispiel #16
0
    void OnTriggerEnter(Collider ballCollider)
    {
        Debug.Log("Ha entrado");
        manager.ResetScore();
        Debug.Log("Abriendo puerta lanzador");
        launcherDoor.SetState(true);

        GameObject ball = ballCollider.gameObject;

        //Mover bola al punto de spawn
        ball.transform.position = spawnBallPosition.position;
        ball.transform.rotation = spawnBallPosition.rotation;
        Debug.Log("Bola movida al spawn");
        //Poner a cero las velocidades del rigidbody
        Rigidbody rb = ball.GetComponent <Rigidbody>();

        rb.velocity        = Vector3.zero;
        rb.angularVelocity = Vector3.zero;
        Debug.Log("Velocidades y direccion reseteadas");
        //Acceder al componente Ball Launcher de la bola y la variable fired ponerla a false
        BallLauncher launcher = ball.GetComponent <BallLauncher>();

        launcher.fired = false;
    }
Beispiel #17
0
 void Start()
 {
     ballLauncher = FindObjectOfType <BallLauncher> ();
     animator     = GetComponent <Animator> ();
 }
Beispiel #18
0
 private void Awake()
 {
     ballLauncher = FindObjectOfType <BallLauncher>();
 }
Beispiel #19
0
 void Start()
 {
     vm       = GameObject.Find("Managers").GetComponent <VariableManager> ();
     pitchHit = false;
     bl       = GameObject.Find("Managers").GetComponent <BallLauncher> ();
 }
 void Start()
 {
     ballLauncher = FindObjectOfType <BallLauncher>();
 }
Beispiel #21
0
 void Start()
 {
     m_BallLauncher = GetComponent <BallLauncher>();
     StartCoroutine(SerchNearestPlayer());
     m_RandomOffsetPos = MathUtil.RandomRange(-m_RandomOffset, m_RandomOffset);
 }
Beispiel #22
0
 // Use this for initialization
 void Start()
 {
     rb       = GetComponent <Rigidbody>();
     launcher = FindObjectOfType <BallLauncher>();
 }
Beispiel #23
0
 void Start()
 {
     ballLauncher = FindObjectOfType <BallLauncher>();
     rigidbody2D  = GetComponent <Rigidbody2D>();
 }
Beispiel #24
0
 public SimulationController()
 {
     _ballLauncher    = ServiceLocator.Get <BallLauncher>();
     _brickSpawner    = ServiceLocator.Get <BrickSpawner>();
     _boardController = ServiceLocator.Get <BoardController>();
 }
Beispiel #25
0
 void Awake()
 {
     bl = FindObjectOfType <BallLauncher>();
 }