예제 #1
0
    private void Awake()
    {
        m_Animator   = GetComponent <Animator>();
        myRigidbody  = gameObject.GetComponent <Rigidbody2D> ();
        affectSlider = myRigidbody.GetComponent <AwarenessScript> ();
        affectSlider.m_Slider.maxValue = timeUntilSeesYou;
        affectSlider.timeUntilSeesYou  = timeUntilSeesYou;

        timeUntilTurnAround = walkDistance;
        m_MoveVector        = new Vector3(3, 0);
        m_Collider          = GetComponent <Collider2D>();
        m_SpriteRenderer    = GetComponent <SpriteRenderer>();


        billie = GameObject.Find("Billie");


        //Start CharCon2d
        m_Rigidbody2D = GetComponent <Rigidbody2D>();
        m_Capsule     = GetComponent <CapsuleCollider2D>();

        m_CurrentPosition  = m_Rigidbody2D.position;
        m_PreviousPosition = m_Rigidbody2D.position;

        m_ContactFilter.layerMask    = groundedLayerMask;
        m_ContactFilter.useLayerMask = true;
        m_ContactFilter.useTriggers  = false;
        //SetHorizontalSpeed (speed);

        //Physics2D.queriesStartInColliders = false;

        m_Animator.SetBool("HasSeenYou", true);
        position = GetComponent <Transform> ().position;
    }
예제 #2
0
 protected override void Start()
 {
     base.Start();
     rb             = GetComponent <Rigidbody>();
     _eyes          = GetComponent <AwarenessScript>();
     _controller    = GetComponent <PlayerController>();
     _viewCamera    = Camera.main;
     _gunController = GetComponent <GunController>();
 }
예제 #3
0
 // Start is called before the first frame update
 void Start()
 {
     eyes = GetComponent <AwarenessScript>();
 }