Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if(ballHandler == null)
          ballHandler = FindObjectOfType(typeof(SpitBallHandler)) as SpitBallHandler;

        lifeTimer += Time.deltaTime;
        if(lifeTimer >= timeToLive) {
          lifeTimer = 0;
          ballHandler.PushSpitBall(gameObject);
        }
    }
Ejemplo n.º 2
0
 void Start()
 {
     ballHandler = FindObjectOfType(typeof(SpitBallHandler)) as SpitBallHandler;
 }