示例#1
0
        public bool ElevatorOnPath(OffMeshLink link)
        {
            Elevator.MeshLinkDetector check = null;

            if (link != null)
            {
                check = link.GetComponent <Elevator.MeshLinkDetector>();
            }
            else
            {
                Debug.Log(link);
            }

            if (check != null)
            {
                return(true);
            }

            return(false);
        }
示例#2
0
        public void GetElevatorInformation(Squad.Core core, OffMeshLink link, Vector3 startPos)
        {
            Elevator.Elevator mainPart = link.GetComponent <Elevator.MeshLinkDetector>().main;
            core.mainPart = mainPart;

            if (link.startTransform.position == startPos)
            {
                core.entry = GetLevel(mainPart, link.startTransform.position);
                core.exit  = GetLevel(mainPart, link.endTransform.position);
            }
            else
            {
                core.entry = GetLevel(mainPart, link.endTransform.position);
                core.exit  = GetLevel(mainPart, link.startTransform.position);
            }

            if (core.entry != core.exit || mainPart != null)
            {
                core.toUseElevator = true;
            }
        }