コード例 #1
0
 public void ConvertToManualCoverPoints()
 {
     foreach (CoverPoint coverPoint in this.CoverPoints)
     {
         ManualCoverPoint position = (new GameObject("MCP")).AddComponent <ManualCoverPoint>();
         position.transform.localPosition = Vector3.zero;
         position.transform.position      = coverPoint.Position;
         position.Normal          = coverPoint.Normal;
         position.NormalCoverType = coverPoint.NormalCoverType;
         position.Volume          = this;
     }
 }
コード例 #2
0
        private void Awake()
        {
            NavMeshHit navMeshHit;

            AiLocationManager.Managers.Add(this);
            if (this.SnapCoverPointsToGround)
            {
                ManualCoverPoint[] componentsInChildren = this.CoverPointGroup.GetComponentsInChildren <ManualCoverPoint>();
                for (int i = 0; i < (int)componentsInChildren.Length; i++)
                {
                    ManualCoverPoint manualCoverPoint = componentsInChildren[i];
                    if (NavMesh.SamplePosition(manualCoverPoint.Position, out navMeshHit, 4f, -1))
                    {
                        manualCoverPoint.transform.position = navMeshHit.position;
                    }
                }
            }
        }