Exemple #1
0
 // Start is called before the first frame update
 void Start()
 {
     body                  = GetComponentInChildren <Rigidbody2D>();
     tongueLine            = GetComponentInChildren <LineRenderer>();
     tip                   = GetComponentInChildren <TongueTip>();
     tongueLine.startWidth = 0.5f;
     tongueLine.endWidth   = tongueLine.startWidth;
 }
 // Start is called before the first frame update
 void Start()
 {
     body       = GetComponentInChildren <Rigidbody2D>();
     tongueLine = GetComponentInChildren <LineRenderer>();
     tip        = GetComponentInChildren <TongueTip>();
     anim       = GetComponent <Animator>();
     // tongueLine.startWidth = 0.5f;
     // tongueLine.endWidth = tongueLine.startWidth;
     tongueLine.sortingLayerName = "Hidden";
 }
    // Use this for initialization
    void Start()
    {
        _startTime   = Time.time;
        _tongue      = _tongueObject.GetComponent <Tongue>();
        _tongueTip   = gameObject.GetComponentInChildren <TongueTip>();
        _rigidbody   = GetComponent <Rigidbody>();
        _audioSource = GetComponent <AudioSource>();

        _healthBar   = healthBarObj.GetComponent <HealthBar>();
        crosshairObj = Instantiate(crosshairPrefab);
        _crosshair   = crosshairObj.GetComponent <Crosshair>();
        UpdateHealth(_maxHealth);
    }