Example #1
0
 void OnCollisionEnter(Collision collider)
 {
     if (collider.transform.tag == "Player" && (cabbageBody.transform.position.y - collider.transform.position.y) > 0.5f)
     {
         PlayerLife pl = collider.gameObject.GetComponent <PlayerLife>();
         pl.Health = 0f;
     }
 }
Example #2
0
        //assigning references
        private void InitializePlayerComponents()
        {
            //get all components to manage
            _movement = this.GetComponent<PlayerMove>();
            _life = this.GetComponent<PlayerLife>();
            _pushPull = this.GetComponent<PushPull>();

            //tell all components this is their controller
            AssignController(this);
        }
Example #3
0
        public override void Start(RAIN.Core.AI ai)
        {
            Debug.Log("Caught!");
            GameObject p  = GameObject.FindGameObjectWithTag("Player");
            PlayerLife pl = p.GetComponent <PlayerLife>();

            pl.Health = 0f;

            //pm.EnableRagdoll();
            base.Start(ai);
        }
Example #4
0
        //assigning references
        private void InitializePlayerComponents()
        {
            //get all components to manage
            _movement = this.GetComponent <PlayerMove>();
            _life     = this.GetComponent <PlayerLife>();
            _pushPull = this.GetComponent <PushPull>();
            _footStep = this.GetComponentInChildren <Footstep>();


            //tell all components this is their controller
            AssignController(this);
        }