コード例 #1
0
    public virtual void Start()
    {
        setupAbilities();

        _obstacle = GetComponent <Pathfinding.DetourObstacle>();
        _collider = GetComponent <Collider>();
        _terrain  = Terrain.activeTerrain;

        Transform tempTransform = transform.Find("Humareda");

        if (tempTransform != null)
        {
            _humareda = tempTransform.gameObject;
        }

        tempTransform = transform.Find("Foc");
        if (tempTransform != null)
        {
            _foc = tempTransform.gameObject;
        }
    }
コード例 #2
0
        public uint AddObstacle(DetourObstacle block)
        {
            Assert.IsTrue(_tileCacheHandle.Handle.ToInt64() != 0);

            Vector3[] blockVertices = block.Vertices();
            Vector3   pos           = block.transform.position;

            float[] vertices =
            {
                blockVertices[0].x, blockVertices[0].y - 3.0f, blockVertices[0].z,
                blockVertices[1].x, blockVertices[1].y - 3.0f, blockVertices[1].z,
                blockVertices[2].x, blockVertices[2].y - 3.0f, blockVertices[2].z,
                blockVertices[3].x, blockVertices[3].y - 3.0f, blockVertices[3].z,
            };

            float[] position =
            {
                pos.x, pos.y - 3.0f, pos.z
            };

            return(addObstacle(_tileCacheHandle.Handle, position, vertices, 4, (int)Mathf.Ceil(block.Size.y)));
        }
コード例 #3
0
ファイル: TileCache.cs プロジェクト: srferran/ES2015A
        public uint AddObstacle(DetourObstacle block)
        {
            Assert.IsTrue(_tileCacheHandle.Handle.ToInt64() != 0);

            Vector3[] blockVertices = block.Vertices();
            Vector3 pos = block.transform.position;

            float[] vertices =
            {
                blockVertices[0].x, blockVertices[0].y - 3.0f, blockVertices[0].z,
                blockVertices[1].x, blockVertices[1].y - 3.0f, blockVertices[1].z,
                blockVertices[2].x, blockVertices[2].y - 3.0f, blockVertices[2].z,
                blockVertices[3].x, blockVertices[3].y - 3.0f, blockVertices[3].z,
            };

            float[] position =
            {
                pos.x, pos.y - 3.0f, pos.z
            };

            return addObstacle(_tileCacheHandle.Handle, position, vertices, 4, (int)Mathf.Ceil(block.Size.y));
        }