static void RenderBoxGizmo(CubeArea cubeArea, GizmoType gizmoType)
    {
        colorOld = Gizmos.color;
        mOld     = Gizmos.matrix;

        Gizmos.matrix = cubeArea.transform.localToWorldMatrix;

        Gizmos.color = cubeArea.enabled ? cubeArea.appearance.surfaceColor : Color.clear;
        Gizmos.DrawCube(Vector3.zero, cubeArea.Size);

        Gizmos.color = cubeArea.appearance.edgeColor;
        Gizmos.DrawWireCube(Vector3.zero, cubeArea.Size);

        Gizmos.matrix = mOld;
        Gizmos.color  = colorOld;
    }
Exemple #2
0
        public Area(Vector3 center, Vector3 areaSize, Vector3 halfSize, MapGenerator map)
        {
            this.map = map;
            this.center = center;
            min = center - areaSize;
            max = center + areaSize;
            halfMin = map.PositionToIndex(center - halfSize);
            halfMax = map.PositionToIndex(center + halfSize);

            int halfMinY = halfMin.y;
            halfMin.y = halfMax.y;
            halfMax.y = halfMinY;

            cubeArea = CubePool.Instance.ActiveObject().GetComponent<CubeArea>();
        }
 private void OnEnable()
 {
     Target = target as CubeArea;
 }