Пример #1
0
    public override bool satisfied(CRController controller, CRController target)
    {
        Vector3 cdir = (target.transform.position - controller.transform.position).normalized;
        Vector3 tdir = target.transform.forward;

        if (null != target.GetComponentInChildren<Agent>())
        {
            tdir = target.GetComponentInChildren<Agent>().transform.forward;
        }

        bool result = Vector3.Angle(cdir, tdir) < 60.0f;

        if (!result)
        {
            NetworkChat.instance.send(controller.GetComponent<CRControllerBinding>().owner, "You must be behind your target.", 0);
            return false;
        }

        return true;
    }