public static void strafe(ConsoleSystem.Arg arg)
        {
            RaycastHit raycastHit;
            BasePlayer basePlayer = arg.Player();

            if (!basePlayer)
            {
                return;
            }
            PatrolHelicopterAI patrolHelicopterAI = PatrolHelicopterAI.heliInstance;

            if (patrolHelicopterAI == null)
            {
                Debug.Log("no heli instance");
                return;
            }
            if (!UnityEngine.Physics.Raycast(basePlayer.eyes.HeadRay(), out raycastHit, 1000f, 1218652417))
            {
                Debug.Log("strafe ray missed");
                return;
            }
            Debug.Log(string.Concat("strafing :", raycastHit.point));
            patrolHelicopterAI.interestZoneOrigin = raycastHit.point;
            patrolHelicopterAI.ExitCurrentState();
            patrolHelicopterAI.State_Strafe_Enter(raycastHit.point, false);
        }
Exemplo n.º 2
0
        public static void strafe(Arg arg)
        {
            BasePlayer basePlayer = ArgEx.Player(arg);

            if ((bool)basePlayer)
            {
                PatrolHelicopterAI heliInstance = PatrolHelicopterAI.heliInstance;
                RaycastHit         hitInfo;
                if (heliInstance == null)
                {
                    Debug.Log("no heli instance");
                }
                else if (UnityEngine.Physics.Raycast(basePlayer.eyes.HeadRay(), out hitInfo, 1000f, 1218652417))
                {
                    Debug.Log("strafing :" + hitInfo.point);
                    heliInstance.interestZoneOrigin = hitInfo.point;
                    heliInstance.ExitCurrentState();
                    heliInstance.State_Strafe_Enter(hitInfo.point);
                }
                else
                {
                    Debug.Log("strafe ray missed");
                }
            }
        }