Esempio n. 1
0
    void OnTriggerEnter(Collider col)
    {
        if (col.tag != "WorldMap")
        {
            if (isActive && (col.tag == "Player" || col.tag == "Enemy"))
            {
                isActive = false;
                RailMovement railMovement = col.gameObject.transform.parent.transform.parent.gameObject.GetComponent <RailMovement>();

                railMovement.NextWayPoint();
            }
        }
    }
 public int whereToActivate; // which location will movement activate?
 // Start is called before the first frame update
 void Start()
 {
     rmove   = FindObjectOfType <RailMovement>();
     rManage = FindObjectOfType <RailManager>();
 }
 // Start is called before the first frame update
 void Start()
 {
     anim    = GetComponent <Animator>();
     rmove   = FindObjectOfType <RailMovement>();
     rManage = FindObjectOfType <RailManager>();
 }