示例#1
0
 void Start()
 {
     spr           = GetComponent <SpriteRenderer>();
     anim          = GetComponent <Animator>();
     currentHealth = maxHealth;
     aS            = GetComponent <AnimalSwitch>();
     SetAnim();
 }
示例#2
0
    // Update is called once per frame
    void Update()
    {
        Vector3    pos = new Vector3(transform.position.x, bear.transform.position.y, transform.position.z);
        Ray        ray = new Ray(pos, transform.forward);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit))
        {
            if (hit.transform.gameObject == bear && state == "bear")
            {
                AnimalSwitch s = GetComponent <AnimalSwitch> ();
                s.Switch(s.Bear, s.Bird);
            }
        }
    }
示例#3
0
 void Start()
 {
     aS = GetComponent <AnimalSwitch>();
 }