Example #1
0
 void Start()
 {
     NetSpeed         = 1.0f;
     AccelerationTime = 5.0f;
     movement         = GameObject.FindObjectOfType <MovementFish>();
     audio            = GetComponent <AudioSource>();
 }
Example #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     fishMove = collision.GetComponentInParent <MovementFish>();
     if (fishMove != null && slowed == false)
     {
         fishMove.Slower();
         StartCoroutine(SetInactive());
         Debug.Log("COLlIDED");
     }
 }
Example #3
0
 // Start is called before the first frame update
 void Start()
 {
     //spR = GetComponent<SpriteRenderer>();
     mouth.enabled = false;
     //healthBar = FindObjectOfType<HealthBar>().GetComponent<HealthBar>();
     healthBar.SetMaxTox(maxTox);
     currentTox     = 0;
     currentFood    = 1;
     FoodTimer      = 10.0f;
     SoundTimer     = 1.0f;
     IsPlayingSound = false;
     foodBar.SetCurrentFood(currentFood);
     movementFish.SetMaxSpeed(currentFood);
     pauseMenu = FindObjectOfType <PauseMenu>();
     movement  = FindObjectOfType <MovementFish>();
     audio     = GetComponent <AudioSource>();
 }