예제 #1
0
    // Start is called before the first frame update
    void Start()
    {
        mapmanager = GameObject.Find("Mapmanager");
        mapcontroller temp = mapmanager.GetComponent <mapcontroller>();

        rows = temp.Grows; clos = temp.Gclos;
    }
예제 #2
0
    // Start is called before the first frame update
    void Start()
    {
        mapcontroller temp = GameObject.Find("Mapmanager").GetComponent <mapcontroller>();

        rows = temp.Grows; clos = temp.Gclos;

        GameObject player = GameObject.Find("player");
        Vector3    des    = player.transform.position;

        velocity = (des - gameObject.transform.position) * speed / Vector3.Distance(des, gameObject.transform.position);
    }
예제 #3
0
    void Start()
    {
        //得到速度向量

        mapcontroller temp = GameObject.Find("Mapmanager").GetComponent <mapcontroller>();

        rows = temp.Grows; clos = temp.Gclos;
        Vector3 des = new Vector3(clos, rows, 0);

        des = des - gameObject.transform.position;

        velocity = (des - gameObject.transform.position) * speed / Vector3.Distance(des, gameObject.transform.position);

        Enamybulltes = GameObject.Find("Mapmanager").GetComponent <mapcontroller>().Enamybulltes;
    }